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

Malloc and performance optimisations for Clone TX and toBytesHelper #150

Closed
wants to merge 8 commits into from

Conversation

icellan
Copy link
Contributor

@icellan icellan commented Apr 18, 2023

Malloc is expensive and this pull request removes all mallocs from toBytesHelper used by ToBytes() and ToExtendedBytes(). This makes it much faster to get the bytes of a transaction when you are doing millions of transactions per second.

I also optimized Clone() of tx, which is used in various places, for instance when validating signatures.

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Patch coverage: 94.44% and project coverage change: +0.02 🎉

Comparison is base (79b6991) 80.61% compared to head (1999018) 80.64%.

❗ Current head 1999018 differs from pull request most recent head 8281ffe. Consider uploading reports for the commit 8281ffe to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #150      +/-   ##
==========================================
+ Coverage   80.61%   80.64%   +0.02%     
==========================================
  Files          38       38              
  Lines        4112     4179      +67     
==========================================
+ Hits         3315     3370      +55     
- Misses        546      559      +13     
+ Partials      251      250       -1     
Impacted Files Coverage Δ
tx.go 76.45% <90.19%> (+0.37%) ⬆️
input.go 82.30% <100.00%> (+2.70%) ⬆️
output.go 90.00% <100.00%> (+3.04%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mergify mergify bot closed this May 10, 2023
@mergify
Copy link
Contributor

mergify bot commented May 10, 2023

This pull request looks stale. Feel free to reopen it if you think it's a mistake.

@mergify mergify bot added the stale label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants