gregchapman-dev / musicdiff

A music score notation diff package (and command line tool)
Other
32 stars 4 forks source link

Don't store note_list (a list of music21 Notes) in AnnVoice. #3

Closed gregchapman-dev closed 2 years ago

gregchapman-dev commented 2 years ago

This should improve diff performance, removing a completely unnecessary deepcopy of every Note in the score.

gregchapman-dev commented 2 years ago

I'm honestly not sure how much performance is gained, but I was breaking into the debugger during a long diff, and almost every time was in deepcopy of a Note/Rest. We were so careful to only use ids in annotated objects, but this one snuck past. No-one uses it, except as a temporary during init, so I just stopped putting it in self. It's just a variable in init now.

fosfrancesco commented 2 years ago

Very good catch! I guess this will decrease the necessary memory a lot for long scores