-
Notifications
You must be signed in to change notification settings - Fork 151
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
Refactoring dyn-abi
to performance parity with ethabi
#144
Conversation
dyn-abi
dyn-abi
to performance parity with ethabi
let input = encode_struct_sol_values(); | ||
let input = DynSolValue::Tuple(input.to_vec()); | ||
b.iter(|| ty.encode_single(black_box(&input).clone())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was doing an extra alloc in the encode_single
Can you share the benchmark results (with % gains)? |
Here's the comparison to main. To generate this I ran A significant % of gains were from making the benches apples-to-apples. The versions in main actually cause the dyn-abi to do extra work that ethabi was not required to. I'd guess that about 100ns of the improvement is from making the bench equivalent |
This PR brings dyn-abi to performance parity with ethabi (or better) on all benchmarks
It does this by
Followup work may bypass decoding into tokens and decode directly into values
Motivation
dyn-abi is slow and should be fast 😤
Solution
make it faster
PR Checklist