Optimized SongInit a bit #1
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: chrisly42/PretrackerRaspberryCasket#1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "song-init-opt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I just had a quick look at the code and noticed the mul with
15
and figured that it can be replaced with shift + sub instead. I haven't done any testing of this code, but I figured I could just do a PR with it and you use it if you want.If I done my math right it saves 20 cycles each iteration, but it does add 4 bytes in size.
Thanks for looking into it. SongInit is optimized for size, not for speed, especially as this case is called at most 23 times. Filesize is two bytes larger, but the shrinkled size three bytes more, so I'd rather not change the code as I see no benefit.
Pull request closed