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

Improve horizontal spacing performance by up to 70% if systems are locked #27512

Merged

Conversation

mike-spa
Copy link
Contributor

@mike-spa mike-spa commented Apr 2, 2025

Don't know how this didn't occur to me before. The main thing that's expensive about horizontal spacing is that we need to update it measure by measure as we add measures to the system, in order to update the resulting system width and therefore decide how many measures to fit (i.e. where to break the line). But if a system is locked that's not necessary, because the line breaking decision is not up to us, which means we can skip all the intermediate calculations and just continue adding measures until the last measure of the current lock. This saves approximately 2/3 of the computation time.

Horizontal spacing only accounts for a relatively small part of the whole layout computation time, so it's not like this is going make a massive difference in the user experience. Still, in my test file (orchestral piece with all parts generated and all systems locked both in score and in parts) this saved 9-10% of the total layout time, not too bad.

@mike-spa mike-spa requested review from oktophonie and miiizen April 2, 2025 15:26
@mike-spa mike-spa merged commit bd59bf5 into musescore:master Apr 8, 2025
22 checks passed
@oktophonie oktophonie moved this to In Progress in MuseScore Studio 4.6 Apr 8, 2025
@oktophonie oktophonie moved this from In Progress to Done in MuseScore Studio 4.6 Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants