-
Notifications
You must be signed in to change notification settings - Fork 95
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
resolve performance issue caused by using DoubleArrayCache.getArrayExact #557
Conversation
displaying live data from data sets with fluctuating size created a lot of GC pressure because the DoubleArrayCache required a new allocation almost every call to getArrayExact adjusting the ErrorDataSetRenderer and related classes to call DoubleArrayCache.getArray (using best fit strategy) instead removes this overhead the time spend in the cache easily took 90% of the render time in our case, because the cache list grews quite large
I ran into the same issue a couple years ago and did a little proof of concept with a plugin mechanism for the allocation (see #370 for the discussion). |
Codecov ReportBase: 51.74% // Head: 51.70% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #557 +/- ##
============================================
- Coverage 51.74% 51.70% -0.04%
+ Complexity 6333 6332 -1
============================================
Files 364 364
Lines 36792 36817 +25
Branches 5991 5996 +5
============================================
+ Hits 19037 19038 +1
- Misses 16500 16525 +25
+ Partials 1255 1254 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks @ennerf for finding and linking to the old PR and discussion thread. I guess most of what has been described there still holds true. The core question is a 80/20-type decision: default/safe behaviour for novice/new users (the 80% use case) vs. extensibility for more custom/special cases (the 20% use case). We are open for PR. May I suggest: rather than modifying the existing code (which may perturb other users) it would be nice to generate an interface and allow to supply of custom array caches. @protogenes and/or @ennerf would you be up for it? |
Thank you for the feedback, #370 didn't pop up during my search. Let me add my thoughts on the topic: First, adding an extension point to the various renderer and algorithm implementations requires quite a bit of intricate work to move away from the current global/static cache access. That is not some task that I would attempt to solve with my surface level knowledge of the library. The performance issue that @ennerf and I encountered are also not solved while keeping the current usage of Regardless of that I'm convinced the current or default implementation of the cache and its usage need to be improved. I don't think anyone would be irked by a faster cache implementation and renderer. The performance of the current cache also deteriorates as it traverses the whole list each time in |
Kudos, SonarCloud Quality Gate passed! |
displaying live data from data sets with fluctuating size created a lot of GC pressure because the DoubleArrayCache required a new allocation almost every call to getArrayExact
adjusting the ErrorDataSetRenderer and related classes to call DoubleArrayCache.getArray (using best fit strategy) instead removes this overhead
the time spend in the cache easily took 90% of the render time in our case, because the cache list grews quite large