8000
Skip to content

SVDirectionChange: Use reverse prefix max/min to query max/min position better - #4330

Draft
WilliamQiufeng wants to merge 2 commits into
Quaver:developfrom
WilliamQiufeng:sv-dir-change-optimisation
Draft

SVDirectionChange: Use reverse prefix max/min to query max/min position better#4330
WilliamQiufeng wants to merge 2 commits into
Quaver:developfrom
WilliamQiufeng:sv-dir-change-optimisation

Conversation

@WilliamQiufeng
Copy link
Copy Markdown
Member

This needs testing before being merged. It is not known yet if this brings remarkable improvements. Since this PR is created when I was trying to fix a bug with LN length with changing SSF, so I didn't really test this.

This PR calculates reverse prefix min/max SVDirectionChange.Position for SVDirectionChanges so that maximum/minimum position could be queried in O(1) after knowing the latest direction change.

Furthermore, since SVDirectionChange uses StartTime, we could use binary search, so looking it up now only takes logarithmic time. So this basically makes SetEarliestAndLatestLongNotes() O(log n), where n is number of SV direction changes.

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.

1 participant

0