Conversation
This was referenced Jan 26, 2026
Collaborator
Author
eytan-starkware
approved these changes
Jan 27, 2026
Contributor
eytan-starkware
left a comment
There was a problem hiding this comment.
@eytan-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @TomerStarkware).
eytan-starkware
approved these changes
Jan 27, 2026
Contributor
eytan-starkware
left a comment
There was a problem hiding this comment.
@eytan-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @TomerStarkware).
0119921 to
78aee97
Compare
5364bc8 to
6201638
Compare
This was referenced Jan 27, 2026
…h Vecs. SIERRA_UPDATE_PATCH_CHANGE_TAG=No interface change.
78aee97 to
5f1a0bd
Compare
6201638 to
ebb429a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Optimized the excess cost computation in the Sierra gas analysis by replacing
UnorderedHashMapandUnorderedHashSetwith more efficient vector-based data structures. This change improves performance by using direct indexing instead of hash-based lookups when tracking statement costs.Type of change
Please check one:
Why is this change needed?
The current implementation uses hash-based data structures (
UnorderedHashMapandUnorderedHashSet) for tracking excess costs and finalized statements during gas analysis. Since statements are already indexed sequentially, we can use more efficient vector-based structures with direct indexing, avoiding the overhead of hash computations and lookups.What was the behavior or documentation before?
The code used
UnorderedHashMap<StatementIdx, CostType>andUnorderedHashSet<StatementIdx>for tracking excess costs and finalized statements, requiring hash lookups for each access.What is the behavior or documentation after?
The implementation now uses
vec![None; self.program.statements.len()]andvec![false; self.program.statements.len()]with direct indexing, which provides faster access to the same data without changing the algorithm's behavior.Additional context
This optimization is particularly beneficial for large programs with many statements, as it reduces the computational overhead during gas analysis without changing the functional behavior of the cost computation.