-
Notifications
You must be signed in to change notification settings - Fork 3k
JIT: Optimize creation of binaries #6031
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
While at it, also update the comments, removing mentions of old and new instruction sets. (The old instruction set was removed a long time ago.)
Useful for the JIT because it has fewer arguments and thus can be called using fewer instructions.
CT Test Results 3 files 125 suites 37m 44s ⏱️ Results for commit e5bd2c1. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
8bf949d
to
442cbff
Compare
845d29a
to
69edb96
Compare
06f4a21
to
afd33b8
Compare
mov_imm(ARG3, seg.effectiveSize); | ||
} else if (seg.unit == 0) { | ||
/* Silly but legal. */ | ||
mov_imm(ARG3, 0); |
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.
According to gcov, this line is never run. Is that because the compiler will never emit such code?
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.
Contrary to the comment, a unit size of zero is not legal (at least for integer
segments). I have removed the code.
@@ -1596,8 +1638,200 @@ struct BscSegment { | |||
|
|||
Uint error_info; | |||
Sint effectiveSize; | |||
enum class action { NONE, ACCUMULATE_FIRST, ACCUMULATE, STORE } action; |
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.
Would you mind adding a small description what the different actions do and when they trigger?
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.
Will do.
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 have renamed NONE
to DIRECT
and added more comments.
199ada3
to
e5bd2c1
Compare
In the JIT, improve the code generation for binary construction for segments of fixed widths of no more than 64 bits and for variable width segments that are a set to 0. I have run the benchmark linked to from erlang#5639. On my Intel iMac from 2017, the result without this commit was: == Testing with 1 MB == fun base64:encode/1: 1000 iterations in 16264 ms: 61 it/sec fun base64:decode/1: 1000 iterations in 18597 ms: 53 it/sec With this commit: == Testing with 1 MB == fun base64:encode/1: 1000 iterations in 10955 ms: 91 it/sec fun base64:decode/1: 1000 iterations in 10629 ms: 94 it/sec On my M1 MacBook Pro from 2020 the result before was: == Testing with 1 MB == fun base64:encode/1: 1000 iterations in 12299 ms: 81 it/sec fun base64:decode/1: 1000 iterations in 15147 ms: 66 it/sec After: == Testing with 1 MB == fun base64:encode/1: 1000 iterations in 8550 ms: 116 it/sec fun base64:decode/1: 1000 iterations in 10066 ms: 99 it/sec
e5bd2c1
to
6fc65ab
Compare
In the JIT, improve the code generation for binary construction for segments of fixed widths of no more than 64 bits and for variable width segments that are a set to 0.
I have run the benchmark linked to from #5639.
On my Intel iMac from 2017, the result without this pull request was:
With this pull request:
On my M1 MacBook Pro from 2020 the result before was:
After: