forked from JaderDias/movingmedian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously we were iterating over all the elements in the heap looking for one to remove, making updates O(windowSize). This tracks the index of elements so that removal becomes O(log windowSize) instead. benchmark old ns/op new ns/op delta Benchmark_10values_windowsize1 4090 1262 -69.14% Benchmark_100values_windowsize10 46783 23361 -50.07% Benchmark_10Kvalues_windowsize100 5384446 3378225 -37.26% Benchmark_10Kvalues_windowsize1000 7133066 3972929 -44.30%
- Loading branch information
Showing
1 changed file
with
49 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters