6151b43c47
This benchmark was running very quickly due to an improper setup. The current history implementation expects that a newly inserted entry must be more recent than any existing entries and sorts according to this assumption. The benchmark test inserts increasingly older entries, breaking this invariant. When run in the benchmark, the qute://history/data implementation would see an entry older than the oldest time in the time window and would immediately return with a single "next" entry. This patch inserts data in an order that mantains history's invariant and adds a sanity-check at the end of the test. It does not check for the exact length as not all entries will be within the time window. The length will be some values <= 100000, the check just ensures that there is at least something more than a "next" entry. Before: ---------------------------------------------- benchmark: 1 tests ---------------------------------------------- Name (time in us) Min Max Mean StdDev Median IQR Outliers(*) Rounds Iterations ---------------------------------------------------------------------------------------------------------------- test_qute_history_benchmark 9.3050 21.9250 9.6143 0.2454 9.5880 0.1070 230;360 9930 1 ---------------------------------------------------------------------------------------------------------------- After: -------------------------------------------------- benchmark: 1 tests ------------------------------------------------- Name (time in ms) Min Max Mean StdDev Median IQR Outliers(*) Rounds Iterations ----------------------------------------------------------------------------------------------------------------------- test_qute_history_benchmark 220.7040 223.1900 221.7536 1.1070 221.1939 1.8803 1;0 5 1 ----------------------------------------------------------------------------------------------------------------------- |
||
---|---|---|
.. | ||
end2end | ||
helpers | ||
manual | ||
unit | ||
conftest.py | ||
test_conftest.py |