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

Timeline optimizations #5730

Merged
merged 3 commits into from Oct 21, 2020
Merged

Timeline optimizations #5730

merged 3 commits into from Oct 21, 2020

Conversation

dmitrio95
Copy link
Contributor

As full timeline refactoring (#4542) has not been finished as for this moment, this PR tries to fix the most prominent performance issues of the old Timeline implementation. In general, the following optimizations are implemented:

  1. Optimize the procedure of highlighting currently visible measures by avoiding iterating over all timeline items. This mostly affects score scrolling which could previously be noticeably slowed down on large scores if Timeline was open.
  2. Implement partial updating of measure rectangles in Timeline. Top panel with metadata (tempo changes, time signatures etc.) is still fully updated on each action but the overall procedure of Timeline updating is still much faster than it was before.
  3. Don't update data of invisible Timeline when loading or switching a score. This case has been missed from the previous optimizations for not updating invisible Timeline.

Although Timeline performance is still not ideal with this PR and could be optimized further, this PR should still hopefully make Timeline more usable for people working on relatively large scores. Users who don't use Timeline should also benefit from this PR due to the last optimization for invisible Timeline.

@Harmoniker1
Copy link
Contributor

Great! What about the inability to cooperate with dark mode?

return;
}

const bool layoutAll = layoutChanged && (state.startTick().negative() || state.endTick().negative());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://travis-ci.org/musescore/MuseScore/jobs/652005292#L2630-L2636, "class Ms::Fraction has no member named negative"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I forgot to commit some changes, as always. Will update PR soon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any update on this?

@dmitrio95
Copy link
Contributor Author

What about the inability to cooperate with dark mode?

This pull request doesn't address that, it is solely about performance of using Timeline.

Partial redrawing of meta information rows is not implemented here.

Also avoid rebuilding timeline grid on opening a score if timeline
is invisible.
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

5 participants