forked from scratchfoundation/scratch-vm
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
performanceIdeas for improving performanceIdeas for improving performance
Description
for (var a0 = 10; a0 >= 0.5; a0--) {
}There's room to do better:
- if we know that the number of iterations is an integer, rounding rules don't matter at all, just compare against 0
- repeating constant integer times and repeating length of list times are common operations that might benefit
- for when we can't tell if it's an integer at compile time, it might be better to round at the start of the loop instead of comparing against 0.5 on each iteration
- i am not entirely convinced that this would be faster in the general case as I believe I tried it in forkphorus a long time ago and ended up not keeping it
Tacodiva
Metadata
Metadata
Assignees
Labels
performanceIdeas for improving performanceIdeas for improving performance