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

Make small push value parsing endianness independent #178

Merged
merged 3 commits into from
Sep 17, 2019
Merged

Conversation

chfast
Copy link
Member

@chfast chfast commented Sep 16, 2019

This also makes it faster.

Skylake Mobile:

Comparing bin/evmone-bench-master to bin/evmone-bench
Benchmark                                          Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------
blake2b_huff/analysis                           -0.1002         -0.1002            28            25            28            25
blake2b_shifts/analysis                         -0.2091         -0.2090            15            12            15            12
sha1_divs/analysis                              -0.0715         -0.0714             3             3             3             3
sha1_shifts/analysis                            -0.1620         -0.1620             3             2             3             2
weierstrudel/analysis                           -0.1195         -0.1195            34            30            34            30
micro/loop_with_many_jumpdests/analysis         +0.0189         +0.0190           113           115           113           115

Haswell:

Comparing bin/evmone-bench-master to bin/evmone-bench
Benchmark                                          Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------
blake2b_huff/analysis                           -0.1524         -0.1523            30            25            30            25
blake2b_shifts/analysis                         -0.2739         -0.2739            16            12            16            12
sha1_divs/analysis                              -0.1160         -0.1160             3             3             3             3
sha1_shifts/analysis                            -0.1585         -0.1586             3             2             3             2
weierstrudel/analysis                           -0.1736         -0.1735            35            29            35            29
micro/loop_with_many_jumpdests/analysis         -0.0195         -0.0195           110           108           110           108

*insert_pos++ = *code_pos++;
instr.arg.small_push_value = load64be(value_bytes);
{
value |= uint64_t{*code_pos++} << insert_bit_pos;
Copy link
Member

Choose a reason for hiding this comment

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

Could it still be in a separate helper function maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

The load64be was only doing bswap. I would need to extract whole case:.

Copy link
Member Author

Choose a reason for hiding this comment

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

I pushed an example how it could look like, but it is up to 30% slower.

Copy link
Member

Choose a reason for hiding this comment

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

Wow then let's leave it, if it's so much slower (why, can't be inlined sometimes?)

push_end change looks fine, though

Copy link
Member Author

Choose a reason for hiding this comment

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

I think returning multiple values and using tuple and std::tie messes it up. But I'm only guessing. I'd need much more time to investigate.

@codecov-io
Copy link

codecov-io commented Sep 17, 2019

Codecov Report

Merging #178 into master will increase coverage by 1.13%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
+ Coverage   85.31%   86.44%   +1.13%     
==========================================
  Files          22       22              
  Lines        2261     2258       -3     
  Branches      219      220       +1     
==========================================
+ Hits         1929     1952      +23     
+ Misses        305      279      -26     
  Partials       27       27

@chfast chfast merged commit fda064f into master Sep 17, 2019
@chfast chfast deleted the small_push_parse branch September 17, 2019 10:37
jwasinger pushed a commit to jwasinger/evmone that referenced this pull request Apr 27, 2021
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