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
The compiler currently requires all local and temporary variables to be boxed. This introduces a significant performance penalty.
For instance, in the following snippet:
localx=0fori=1, 10dox=x+iend
every arithmetic operation with x or i involves unboxing it, performing the operation, and boxing the result again. Boxing here is not necessary: it can be determined statically that x is and i are integers, so they can be replaced with primitives while maintaining semantics.
How to go about this
The required static type analysis is already in place. The only remaining thing to do is to change the layout of the generated code to support unboxed local variables and temporaries, and wire the operations up accordingly.
The text was updated successfully, but these errors were encountered:
The compiler currently requires all local and temporary variables to be boxed. This introduces a significant performance penalty.
For instance, in the following snippet:
every arithmetic operation with
x
ori
involves unboxing it, performing the operation, and boxing the result again. Boxing here is not necessary: it can be determined statically thatx
is andi
are integers, so they can be replaced with primitives while maintaining semantics.How to go about this
The required static type analysis is already in place. The only remaining thing to do is to change the layout of the generated code to support unboxed local variables and temporaries, and wire the operations up accordingly.
The text was updated successfully, but these errors were encountered: