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
@nicolasstucki I just tried your #12157 branch to see the effect it would have on the bytecode.
Recompiling the code as-is (i.e. so with the manual inline matching and delegation for primitives), the generated bytecode doesn't change
Changing the inline ops to simply be a == b and a != b, the generates bytecode matches that of Scala 2.13
It's awesome to see that #12157 brings us to parity with Scala 2.13, but I'm not sure it should close this issue. Why is it that even the new bytecode for inline a == b not the same as a manual a == b?
I would've thought that after macro expansion the resulting ASTs would be the same and therefore should result in the same, efficient bytecode. That's why I was wondering if there's some optimisation phase that's not being applied after macro expansion. WDYT?
In my UnivEq library I have
==*
/!=*
ops which are macros that expand to normal==
/!=
.c.Expr[Boolean](q"$a == $b")
Comparing the bytecode generated for:
we get this for Scala 2.13 (note: no
-opt
flags used):and this for Scala 3
The Scala 3 bytecode seems inefficient compared to that of Scala 2.13. Ideally they'd be the same for something this simple, no?
The text was updated successfully, but these errors were encountered: