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
Use concurrent sets or queues #3570
Conversation
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.
There is still probably a performance problem with waitList.contains() as it’s still a queue, can’t we use some kind of linkedhashset instead and always remove first item from it?
Using The |
On my side after replacing Queue with LinkedHashSet I used something like:
I could not iterate over the waitList and remove at the same time because "processFile" influenced the set while I was iterating through it. |
Maybe we could use |
@jelovirt I'm not sure how many automatic tests for performance has the DITA OT, in this case such a test could be created to populate the sets in GenMapAndTopicListModule with lots of data and then to use the access methods and see how fast they return.. then you could switch implementations inside the class and see if you notice any improvement. |
Signed-off-by: Jarno Elovirta <jarno@elovirta.com>
66d1733
to
cc115ba
Compare
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.
Looks ok, I will try next week the changes with the large project.
@raducoravu What do you think about this? Are you able to run the same benchmark again? |
@jelovirt I will run the processing on Monday and report back. |
@jelovirt I can confirm the latest fix no longer produces the CPU usage problems I noticed with the original code in GenMapAndTopicListModule. I profiled both with the fix (and the problem was no longer noticed) and without the fix (and the problem with the queue.contains() was noticed in the profiler) |
Description
Use concurrent sets and queues where applicable.
Motivation and Context
Contains operations are faster on a dedicated set implementation.
How Has This Been Tested?
Tests pass.
Type of Changes
Documentation and Compatibility
None needed