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
In the current version the generated code is kind of allocation heavy in regards to transformers, let's take a look at what is generated (Output of DebugMacros.code):
We can see that for each 'sub-transformation' we allocate a new transformer to then just call transform and get the result, we can simplify it by extracting the inside of the Transformer lambda and calling it directly, so after optimizations this code should look like this:
arainko
changed the title
Optimize the number of Transformer instances during product transformations by rewriting the generated code
Optimize the number of Transformer instances during product transformations
Oct 22, 2022
example:
In the current version the generated code is kind of allocation heavy in regards to transformers, let's take a look at what is generated (Output of
DebugMacros.code
):We can see that for each 'sub-transformation' we allocate a new transformer to then just call
transform
and get the result, we can simplify it by extracting the inside of theTransformer
lambda and calling it directly, so after optimizations this code should look like this:So pretty much something we'd write by hand, this optimization can also be done on
ToAnyVal
andFromAnyVal
transformers.The text was updated successfully, but these errors were encountered: