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

Faster deepcopy from reduce_ex #1464

Merged
merged 9 commits into from
Oct 14, 2022
Merged

Faster deepcopy from reduce_ex #1464

merged 9 commits into from
Oct 14, 2022

Conversation

mscuthbert
Copy link
Member

Use reduce_ex and the private copy._reconstruct() to take advantage of C-language state for custom deepcopies.

PurgeOrphans after every deepcopy.

Change to derived contextSites -- the derivation origin is included in the context sites. The former behavior looks like a bug.

volume keeps a strong reference to its client.

StreamStatus keeps a strong reference to its client.

Stream.toSoundingPitch checks derivations. This was intended behavior originally but was relying on orphans not being purged to do so.

Stream.measure() [not .measures() nor Score.measure()] gets a substantial speedup by not creating a new Part.

TODO: remove "collect" from .measure() and see if gatherSpanners can also be removed from Score.measure()

Remove weakrefs from getstate several places.

@coveralls
Copy link

coveralls commented Oct 14, 2022

Coverage Status

Coverage decreased (-0.0006%) to 93.056% when pulling e0983db on reductor into f3ae034 on master.

Merging this rather than #1463 but some good improvements there that need to be integrated.
@mscuthbert
Copy link
Member Author

Realtime improvement: about 10% on small scores.

However, not seeing a speedup on Beethoven opus132. 6% slower. Might be some sort of hickup with extra copies of a site? 30000 notes. Or the removal of the duration deepcopy speedups? Will try to fix that.

faster to just do our own _IMMUTABLE check first.

looks like a bigger speedup
@mscuthbert
Copy link
Member Author

Removed slowdowns. Good performance now, and it's a simplification to the system in any case.

@mscuthbert mscuthbert merged commit 240453b into master Oct 14, 2022
@mscuthbert mscuthbert deleted the reductor branch October 14, 2022 21:04
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.

2 participants