Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Save auction data in parallel with competition #3010

Open
sunce86 opened this issue Sep 24, 2024 · 3 comments
Open

feat: Save auction data in parallel with competition #3010

sunce86 opened this issue Sep 24, 2024 · 3 comments
Labels
E:6.2 Time to Happy Moo See https://github.com/cowprotocol/pm/issues/77 for details

Comments

@sunce86
Copy link
Contributor

sunce86 commented Sep 24, 2024

Problem

Several auction related database tables are saved only after the competition is done. This is implemented like this, so that we avoid saving of auction data for auctions that did not have any solution reported (empty auctions are not useful). The second reason is also historical because we wanted to save only the prices and fee policies that were used in the competition (in the meantime we switched to saving all auction prices and will probably move to saving all fee policies).

Suggested solution

Saving of following auction related tables can happen in parallel with competition to save time. But then, we also need to delete auction data for auctions without solutions, and that can happen

  1. After competition in a fire and forget manner, or
  2. As a periodical db cleanup task

Affected tables:

  1. auction_orders
  2. auction_prices
  3. surplus_capturing_jit_order_owners
  4. fee_policies

Inspired by 200ms time spent for saving fee policies for all orders in the auction.

@sunce86 sunce86 added the E:6.2 Time to Happy Moo See https://github.com/cowprotocol/pm/issues/77 for details label Sep 24, 2024
@squadgazzz
Copy link
Contributor

squadgazzz commented Sep 25, 2024

The whole save_competition takes at most 250ms at the moment.
image
Since #3013 is merged, auction_orders and auction_prices should be executed in parallel. That would save us up to ~100ms only. Not a big win, actually.

@sunce86
Copy link
Contributor Author

sunce86 commented Sep 26, 2024

@squadgazzz Thanks for looking into it. This surely lowers the priority of the issue but I think we should tackle it eventually since it's a purely technical thing that delays runloop.

Copy link

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:6.2 Time to Happy Moo See https://github.com/cowprotocol/pm/issues/77 for details
Projects
None yet
Development

No branches or pull requests

3 participants