-
Notifications
You must be signed in to change notification settings - Fork 214
Synchronize the access to LRUCache #978
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
base: main
Are you sure you want to change the base?
Conversation
ramele1907
commented
Dec 18, 2024
- a wizard that is creating multiple cdt projects encounters ConcurrentModificationException
Hi @ramele1907 - thanks for the PR. Unfortunately the code as provided doesn't compile. See build ouput for more details.
Because # of reads far outweigh number of writes and you indicated that multiple projects are being created simultaneously, did you consider concurrency instead of synchronizing all accesses to the map? Those caches were added in 9e7b5be to dramatically speed up the code, and I think that adding synchronized around each read access may have an unintentional slowdown. If you can demonstrate that It would help if there is a way to reproduce the problem so that we can see the problem in action. |
@ramele1907 Would you like to have a look at this and see if you can resolve the compile errors and other comments I made in my preliminary review #978 (comment) |
229d077
to
7d47221
Compare
@jonahgraham I resolved the compile errors. I will try to use concurrency instead of synchronization to avoid performance issues. Regarding the reproduction topic I will try to create a mock plugin with a wizard that creates multiple projects. |
Great - I will set the build off running. On your next update please update to the latest HEAD of the main branch.
I'm pleased you found concurrency easy enough to do. Did you calculate the performance issue? Was it significant?
Wonderful! I recently did something similar by creating an example CMake project wizard that isn't shipped to customers, but demonstrates how to make custom wizards. See https://github.com/eclipse-cdt/cdt/blob/main/NewAndNoteworthy/CDT-12.0.md#cmake-support-easier-for-extenders-and-isvs |
Also did you see this comment from my original review #978 (comment)?
I am relying on you to verify that my statement is true (that the inner maps need addressing) |
7fc6a66
to
1cec1fc
Compare
I agree, the access to
I saw no performance gain in my product after switching from synchronization to concurrency. I think the computation of the values was the bottleneck addressed in 9e7b5be
Thank you for your suggestion! I will come back with updates on this topic. |
- a wizard that is creating multiple cdt projects encounters ConcurrentModificationException
1cec1fc
to
8bc7a14
Compare
@ramele1907 I see that you did a merge, but that didn't ended up getting pushed as the latest commit in this PR. I have merged and rebased your change onto the latest HEAD commit so that the workflows can run. |
We are nearly out of time for CDT 12.0. Are there more updates coming on this topic? |