-
Notifications
You must be signed in to change notification settings - Fork 502
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
Optimize Orderbook loading to use sql rows stream directly #1622
Comments
Offers have gone up 10x; agree this is important. |
Hello @bartekn , after some review with @tamirms , it looked like |
@sreuland it's possible that rows are streamed in sqlx. The problem is all the stream rows are then added to a result |
Ok, I may have misread on expectation, is the request to address the receiving iteration of results with |
I'm suggesting to change |
Ok, got it, the loading of the orderboook graph should be refactored to load direct from sql.Rows iteration and remove the intermediate step of loading the sql.Rows to a slice first. Also, during investigation on this with @tamirms, he mentioned it would likely be worthwhile to do the same refactor for |
…dity pool callback funcs
…dity pool callback funcs
Currently
GetAllOffers
is used to load all offers from a database into in-memory order book graph. Currently, there are around 33k offers in the public network however, if this number increases in the future this function may require more memory. Instead, we should stream offers from a DB usingsql.Rows
. We already use this method in several places in Horizon so check them for reference.The text was updated successfully, but these errors were encountered: