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(coverage): improve HitMap merging and internal repr #9456

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Dec 2, 2024

  • use u32 and HashMaps instead of usize/u64 and BTreeMap
  • simplify HitMaps::merge

Lots of time spent in merge for inserting in the right order, but the order was never checked (consistent_bytecode is unused and HitMap::merge returned Result, presumably this was removed at a certain point)

forge coverage on solmate from 29s to 16s

Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@mattsse mattsse merged commit b7a065f into master Dec 2, 2024
21 checks passed
@mattsse mattsse deleted the dani/coverage-perf-maps branch December 2, 2024 18:56
@mattsse
Copy link
Member

mattsse commented Dec 2, 2024

29s to 16s

wow, just hitmaps

@DaniPopes
Copy link
Member Author

Yeah turns out that optimizing a function that's called 2 billion times might have a lot of impact 👍

@grandizzy
Copy link
Collaborator

asked superform to report back new coverage time, would be interesting to see, starting ref 1h15m
https://github.com/superform-xyz/superform-core/actions/runs/12116942111/job/33780028573?pr=614

@0xTimepunk
Copy link

Seeing a huge improvement
telegram-cloud-document-4-5942903830378190072

Previously this was taking +30m and often times killed due to OOM issues

Memory fairly stable on my local as well!

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

Successfully merging this pull request may close these issues.

4 participants