You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've then got 3 instructions of actual logic and 8 of boilerplate and when it comes to execution we have 3*num_iterations instructions of actual logic and 2+6*num_iterations of boilerplate. This gives us a tradeoff between bytecode size and execution speed.
We should aim to unroll any loops where loop_instructions * num_iterations <= loop_instructions + 8 => loop_instructions * (num_iterations - 1) <= 8 as this will reduce bytecode sizes. There's a decent chance that we'd get benefits for unrolling larger loops as well due to constant folding.
The text was updated successfully, but these errors were encountered:
Here we've got a for-loop with a small and simple body, this function compiles to:
We've then got
3
instructions of actual logic and8
of boilerplate and when it comes to execution we have3*num_iterations
instructions of actual logic and2+6*num_iterations
of boilerplate. This gives us a tradeoff between bytecode size and execution speed.We should aim to unroll any loops where
loop_instructions * num_iterations <= loop_instructions + 8
=>loop_instructions * (num_iterations - 1) <= 8
as this will reduce bytecode sizes. There's a decent chance that we'd get benefits for unrolling larger loops as well due to constant folding.The text was updated successfully, but these errors were encountered: