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

Pools page, bring blocking queries earlier #3167

Open
ValarDragon opened this issue Apr 26, 2024 · 3 comments
Open

Pools page, bring blocking queries earlier #3167

ValarDragon opened this issue Apr 26, 2024 · 3 comments

Comments

@ValarDragon
Copy link
Member

On the pools page, I see the following two queries taking a long time (180-200ms), and appear to be blocking more queries that are required for page stability.

Slow queries:

These queries come after other queries on this page such as:

  • epochs query
  • Get osmo price
  • get market pools ?

These slow queries block the following (much slower) queries, however there is no dependence and they should be parallelized:

@jonator
Copy link
Member

jonator commented Apr 26, 2024

WDYM by blocking? The queries are dependent on the mounting of the component tree, which may have some serial properties but I'm not quite sure how the guts of the React engine layout the tree initially. Further, a pitfall of building a dapp is often you need to wait to get the user address from the wallet (which may be blocked on installing wallet client code) which often triggers a flurry of blocked queries once we get that address. In web2, we can normally get that user identifier on the initial query from a browser cookie. Perhaps that's what you're seeing? I'm spitballing and any other input would be appreciated here.

For expensive queries, we tell tRPC not to batch them with other tRPC queries (like you see with the last query, assets.getUserMarketAsset,assets.getAssetHistoricalPrice,assets.getUserAsset). So, expensive queries operate independently and should not be blocked or block any other queries.

The "idea" with batching is it justifies small cheap tRPC queries by automatically combining them at runtime and reducing total networking overhead. But, I'm not sure the observed performance benefits are there. I'd like to verify that it runs the batch in parallel in the server as well, it should. But, it could just be the multi region & edge problem.

@MaxMillington
Copy link
Collaborator

MaxMillington commented Jun 18, 2024

@jonator @Amosel was this solved at the offsite? If so, can we close?

Copy link
Member

jonator commented Jun 18, 2024

We only made improvements to user positions. The user pools query will likely need to be moved to SQS to be optimized enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants