-
Notifications
You must be signed in to change notification settings - Fork 37
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
Lower memory footprint #906
Comments
Two further extreme ideas:
Alternative option for 1: use two bits of long startTime for state (with -FIRST_ACCESS_NANOS correction, the bits will be always free from time) |
Have you tried a custom priority queue (similar to ScheduledThreadPoolExecutor.DelayedWorkQueue) instead of ConcurrentSkipListSet for tasks? |
I have not tried a different implementation of a priority queue. I chose |
@Ladicek If you have time and interest, you can play with a custom PriorityQueue (early beta/draft/only for testing) Less memory usage, blocking/non-blocking seems irrelevant in simple tests The profiler shows that the memory cost of the current implementation (ConcurrentSkipListSet) is negligible compared to, for example, CompletableStage mechanics. So this is a very theoretical subject. |
I originally chose the |
I have tested with 10_000_000 scheduled events and current (ConcurrentSkipListSet) implementations works fine. |
Even better! :-) |
Please, look at the series of steps, as a result of which I have reduced the amount of used memory by almost 2 times.
https://github.com/magicprinc/smallrye-fault-tolerance/commits/feature/compact-timer
Plus
and other micro cleanups (Collections.newSetFromMap(new ConcurrentHashMap<>())→ConcurrentHashMap.newKeySet())
I hope you find these useful
PR: #907
The text was updated successfully, but these errors were encountered: