-
Notifications
You must be signed in to change notification settings - Fork 331
Make small push value parsing endianness independent #178
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
Conversation
This way is also faster.
| *insert_pos++ = *code_pos++; | ||
| instr.arg.small_push_value = load64be(value_bytes); | ||
| { | ||
| value |= uint64_t{*code_pos++} << insert_bit_pos; |
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.
Could it still be in a separate helper function maybe?
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.
The load64be was only doing bswap. I would need to extract whole case:.
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.
I pushed an example how it could look like, but it is up to 30% slower.
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.
Wow then let's leave it, if it's so much slower (why, can't be inlined sometimes?)
push_end change looks fine, though
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.
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.
45f1c21 to
95b9b04
Compare
Codecov Report
@@ 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 |
This also makes it faster.
Skylake Mobile:
Haswell: