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

Add unsafeFastParseUnits, prefer map.get over array.find #28

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

danielmkm
Copy link
Collaborator

Refactor pass to squeeze as many ms outta this thing as possible.

  • Add unsafeFastParseUnits, removing parseUnits call in TokenAmount.fromHumanAmount, pretty significant reduction in pool parsing time, seeing consistent times under 10ms now, from 20ms+.
  • Refactor the pool entities, removing array.find and array.findIndex calls, preferring the more performant map.get.
  • Added stricter modifiers to pool entity props

@mikemcdonald
Copy link
Member

Nice! Are you using any profiling tools/setup? Or just console time?

@mikemcdonald mikemcdonald merged commit 07a7440 into main Feb 14, 2023
@mikemcdonald mikemcdonald deleted the chore/pool-entity-performance-refactor branch February 14, 2023 14:51
@danielmkm
Copy link
Collaborator Author

Just console time, but would be good to get something better setup for sure.

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

Successfully merging this pull request may close these issues.

2 participants