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

perf: Remove boundary Sqrt calls in TickToSqrtPrice #7600

Open
ValarDragon opened this issue Feb 23, 2024 · 0 comments
Open

perf: Remove boundary Sqrt calls in TickToSqrtPrice #7600

ValarDragon opened this issue Feb 23, 2024 · 0 comments

Comments

@ValarDragon
Copy link
Member

ValarDragon commented Feb 23, 2024

Background

TickToSqrtPrice is currently taking .5% of sync speed at 4 sqrt calls. After #7599 , we will be doing either 2 or 3 sqrt calls. However, we are doing one sqrt of these sqrt calls in all cases to check "boundary" cases. We should be able to remove the boundary sqrt calls, by just making more precise claims on the error bands of sqrtPrice.Square() and tick, err := CalculatePriceToTick(price).

Acceptance Criteria

  • Prove to ourselves its safe to remove these based on error tolerances
  • Remove these calls.

We should re-assess this as sync speed improves for other reasons (e.g. I/O improvements, parallelism, or fixing cosmwasm / IBC overheads), as then this will become more worthwhile.

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

No branches or pull requests

1 participant