For a RRD file with a minimal step size of 1, all values past the last update time would be calculated individually with a step size of 1. That is kind of a waste since the result is always NaN.
This patch handles that case specially, significantly reducing the number of calculations (and thus the running time). There is still an expensive calculation at the transition from the end to NaNs, but that is probably unavoidable unless the step matching gets improved.
The test was done against a RRD graph covering a time span of 1 day (86400 seconds).
For a RRD file with a minimal step size of 1, all values past the last update time would be calculated individually with a step size of 1. That is kind of a waste since the result is always NaN.
This patch handles that case specially, significantly reducing the number of calculations (and thus the running time). There is still an expensive calculation at the transition from the end to NaNs, but that is probably unavoidable unless the step matching gets improved.
The test was done against a RRD graph covering a time span of 1 day (86400 seconds).