Closed Jobarion closed 4 years ago
Wow nice analysis. Bit occupied right now but I will look into it!
I just wanted to check if you were open to fix this :) In that case I'll create a PR, that hopefully simplifies integration and testing for you.
I just wanted to check if you were open to fix this :) In that case I'll create a PR, that hopefully simplifies integration and testing for you.
That would be great!
I found a slightly simpler way of improving the performance of the generateArr function. As copying the array was the issue, I changed that part, according to jsperf it is a bit faster even. https://github.com/ngerritsen/timiks/commit/71e5e514d823e53fa48315d72780d7374842f62e
The PR is merged, thanks for the effort!
Right now, the archive view becomes unresponsive when many values are displayed in one graph, sometimes for a few minutes. The problem seems to be the calculation of stats So far I have been able to identify two issues:
generateArr
method in general.js.A suggestion for
generateArr
:See https://jsperf.com/generatearr/1 for a comparison.
For the moving average calculation, see https://jsperf.com/moving-average-trimmed/1 for an example. The new method would be faster by a factor of 2. It's considerably more complicated, but I think it's worth it. Note that I already used the improved
generateArr
function for the old method.