Before: To compute the cumulative distribution we added every duration into a LongList. This requires O(n) memory, where n is the number of values. Now: We store the durations + the number of occurrences in a LongLongHashMap. This has the potential to reduce the memory requirements if durations occur multiple times. There are a lot of durations with 0, 1, 2 milliseconds. In the worst case every duration is different. In that case the memory usage doubled with this solution. Future: We are currently storing durations with milli seconds precision. We don't have to do that. We cannot draw 100 million different values on the y-axis in an images with only 1000px.
3.7 KiB
3.7 KiB