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): use u32 for IDs, improve analysis #9763

Merged
merged 5 commits into from
Jan 28, 2025

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Jan 27, 2025

  • Use u32 for IDs and PC/IC to reduce memory usage
  • Track "seen items" in find_anchors using source IDs instead of individual item IDs, as no items are shared between different sources. This drastically reduces hash lookups
  • Merge items_by_source_id into SourceAnalysis to create the source ID -> coverage items in the analysis itself
  • Simplify the above mapping from a HashMap<SourceId, Vec<ItemId>> to a Vec<(offset, length)>; this is possible because all source and item IDs are consecutive, see methods on SourceAnalysis and the find_anchors changes

The first commit is cleanup which is affected by the second one

This takes analysis down from 15s to 5s on superform-xyz/superform-core

@grandizzy grandizzy added T-perf Type: performance C-forge Command: forge labels Jan 27, 2025
@grandizzy grandizzy self-requested a review January 27, 2025 18:43
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.

makes sense, thank you!

@DaniPopes DaniPopes merged commit 4d1f72b into master Jan 28, 2025
22 checks passed
@DaniPopes DaniPopes deleted the dani/coverage-perfs branch January 28, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-perf Type: performance
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants