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
While working on #2173 I noticed that we tag a lot of our internal values while working with compcore, some instances of this are:
We tag the variant_id and other information on adt items
Comp.if_ consumes a grain bool as the argument meaning any internally generated if statements use grain bools
This really has no benefit in the case of the in memory items most of the time we are only thouching them in the runtime where we just untag them anyways and if we needed to provide it to a user we could tag it then, and in the case of code generation like if statements this means everytime we generate an if statement we need to include the logic for untagging which increases bundle size. It seems like it would be a better idea to insert an untagging operation around the if_ statement in the Anf tree phase depending on the circumstances, this would allow us to generate internal if statements such as those used in pattern matching without incurring tagging and untagging overhead.
Note: There are a lot of cases when binaryen can optimize these tagging operations away but when the values we are comparing come from memory it seems as though binaryen is not as good at optimizing out these tagging operations.
The text was updated successfully, but these errors were encountered:
While working on #2173 I noticed that we tag a lot of our internal values while working with compcore, some instances of this are:
Comp.if_
consumes a grain bool as the argument meaning any internally generated if statements use grain boolsThis really has no benefit in the case of the in memory items most of the time we are only thouching them in the runtime where we just untag them anyways and if we needed to provide it to a user we could tag it then, and in the case of code generation like if statements this means everytime we generate an if statement we need to include the logic for untagging which increases bundle size. It seems like it would be a better idea to insert an untagging operation around the
if_
statement in theAnf
tree phase depending on the circumstances, this would allow us to generate internalif
statements such as those used in pattern matching without incurring tagging and untagging overhead.Note: There are a lot of cases when binaryen can optimize these tagging operations away but when the values we are comparing come from memory it seems as though binaryen is not as good at optimizing out these tagging operations.
The text was updated successfully, but these errors were encountered: