Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

(volume 0) optimization #22

Closed
daveyarwood opened this issue Nov 23, 2016 · 1 comment
Closed

(volume 0) optimization #22

daveyarwood opened this issue Nov 23, 2016 · 1 comment
Labels

Comments

@daveyarwood
Copy link
Member

Moved from alda-lang/alda#267.

@elyisgreat had the idea that we could optimize performance by not adding silent notes to the :events of a score. In other words, they should behave exactly like a rest of the same duration.

Quoting myself:

If we were to optimize this, this line would probably be the place to do it. On this line, we're constructing a vector of notes to be added to the score. We already have a check to see if the duration of the note is 0 -- if so, no note should be added because a note with a duration of 0 is theoretically just silence. We could also add a check that volume is not 0.

I think this is a premature optimization though, and I don't want to inadvertently break something so I'm in no rush to try it. If someone else can try this change and verify it won't break anything (and maybe add unit tests / benchmarks), I'd happily review a PR.

@daveyarwood
Copy link
Member Author

I don't think this is worth pursuing. Especially with the recent improvements I've been making to the parser (see #37), I don't think this will help performance much, and it seems like it might be useful for us to differentiate between a rest (i.e. no note) and a silent note.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant