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

Optimize receiptCommitment function for parallel processing #2165

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AnkushinDaniil
Copy link
Contributor

This pull request optimizes the receiptCommitment function by introducing parallel processing. Instead of processing each receipt sequentially, the receipts are divided among multiple workers, improving performance.

Fixes #2164

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.34%. Comparing base (37ed095) to head (5836038).

Files with missing lines Patch % Lines
core/receipt.go 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2165      +/-   ##
==========================================
- Coverage   78.41%   78.34%   -0.08%     
==========================================
  Files         100      100              
  Lines        9215     9229      +14     
==========================================
+ Hits         7226     7230       +4     
- Misses       1351     1356       +5     
- Partials      638      643       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

core/receipt.go Outdated

trieMutex.Lock()
_, err := trie.Put(receiptTrieKey, receiptHash)
trieMutex.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think current impl is not the most efficient one, we need to write benchmarks for that. You can add them in receipt_pkg_test.go. First for old impl, then for new one. After that I'll tell what else we can improve

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.

Improve performance of receiptCommitment
2 participants