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

Use ahash in cost tracker #1252

Merged

Conversation

tao-stones
Copy link

Problem

cost_tracker uses HashMap to keep tracking writable accounts CUs. HashMap isn't fast.

Summary of Changes

  • Add benchmarking test for cost_tracker
  • Use ahash for better performance

Fixes #

@tao-stones
Copy link
Author

Master:

test bench_cost_tracker_contentious_transaction     ... bench:  11,625,587 ns/iter (+/- 254,789)
test bench_cost_tracker_non_contentious_transaction ... bench:  17,255,980 ns/iter (+/- 391,458)

This PR:

test bench_cost_tracker_contentious_transaction     ... bench:   3,587,329 ns/iter (+/- 85,738)
test bench_cost_tracker_non_contentious_transaction ... bench:   6,096,914 ns/iter (+/- 163,584)

@tao-stones tao-stones requested review from apfitzge and pgarg66 May 8, 2024 20:03
Copy link

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

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

CostTracker is not serialized on bank. We do not need consistency in hash across cluster. This will speeds up hashing, so an easy win.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.1%. Comparing base (aa2f078) to head (231e2f5).
Report is 44 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #1252     +/-   ##
=========================================
- Coverage    82.1%    82.1%   -0.1%     
=========================================
  Files         886      886             
  Lines      236417   236424      +7     
=========================================
- Hits       194266   194253     -13     
- Misses      42151    42171     +20     

@tao-stones tao-stones merged commit 8a55087 into anza-xyz:master May 9, 2024
49 checks passed
@tao-stones tao-stones deleted the banking-use-shash-in-cost-tracker branch May 9, 2024 00:22
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.

3 participants