-
Notifications
You must be signed in to change notification settings - Fork 78
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
Improve parser performance by removing old JDT/JIT tuning #1813
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1813 +/- ##
=======================================
Coverage 48% 48%
- Complexity 6031 6039 +8
=======================================
Files 670 670
Lines 58541 58539 -2
Branches 8536 8536
=======================================
+ Hits 28570 28581 +11
+ Misses 27808 27794 -14
- Partials 2163 2164 +1
|
I'm pretty sure the main gain here is from the removal of the bounds-check-elimination workaround (i.e. the weird The use of
|
This change made the parser run between 8 and 12% faster
b3c36ca
to
12aed30
Compare
I was also curious. And it's the other way around. The ifcheck is actually still good. It's all in the implementation of After only using the the arrays.copyof, it actuall was even a bit faster (note I also changed the benchmark to run at highest priority). main branch:
this PR:
So roughly 13%. Why is Arrays.copyOf faster? Since it's marked as a
So I'm guessing it does the allocation and moving in a more compact way. |
Ok great. Thanks for the discussion @arnoldlankamp @DavyLandman . I'm merging this. Every 10% helps! |
Interesting, so what seems to have happened is that they basically added a second native array copy implementation. The big difference is that the new one uses SIMD. But why they shoehorned this optimized version into the |
Maybe a next step would be to replace all other occurrences of |
It's because with System.arrayCopy you have no guarantees about non
overlapping source & dest.
So if you know the memory cannot overlap, you can be faster.
…On Sun, 18 Jun 2023, 10:38 arnoldlankamp, ***@***.***> wrote:
Interesting, so what seems to have happened is that they basically added a
second native array copy implementation. The big difference is that the new
one uses SIMD.
But why they shoehorned this optimized version into the Arrays wrapper
implementation, instead of just optimizing System.arraycopy, so everyone
benefits, is a bit of a mystery 🤔 .
—
Reply to this email directly, view it on GitHub
<#1813 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABL3EZ5SJPSLDKNGJPTOOTXL246RANCNFSM6AAAAAAZKN7OVQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yep, they'd need an |
I'm very happy you guys made the parser more efficient. Now I think it's time we close this and move back to usethesource/rascal-language-servers#267, because we should focus on not having the start the entire bootstrapping of the parser generator in deploy-mode at all for the interpreted modules of DSLs. |
This change made the parser run between 8 and 12% faster.
Since the discussion in usethesource/rascal-language-servers#267 pointed towards the parser, I took a look at the profiler, and this method popped up. I thought, maybe 11y of changes of the JDK have caught up.
I think primarily the
Arrays.copyOf
method is implemented in native code, so that gives some benefits.I wrote a small java program that would load all rascal files in the rascal project in memory, and would run the parser over that.
The old code before this fix:
You see the first one the loop that the JIT kicked in.
After applying this change:
So depending on which values you compare, anywhere between 8 and 12% speedup.