Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "sortedlist" option for faster rolling median (#26) #27

Merged
merged 1 commit into from
Feb 5, 2023

Conversation

ajcr
Copy link
Owner

@ajcr ajcr commented Feb 4, 2023

Faster rolling median following suggestions made here: #26

The implementation of SortedList here uses the standard library's bisect module to manipulate a Python list and is considerably faster than the skiplist for small/medium window sizes.

If further performance improvements are required, the SortedContainer library could become an optional dependency with the SortedList implementation there taking precedance over this one where available on the user's system.

@ajcr ajcr merged commit 5a841d0 into master Feb 5, 2023
@ajcr ajcr deleted the faster_rolling_median branch February 5, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant