3 ms·
http://dotty.epfl.ch/docs/reference/metaprogramming/inline.html http://dotty.epfl.ch/docs/reference/metaprogramming/inline.h... But it's there for meta-program
by hocuspocus 5y ago
http://dotty.epfl.ch/docs/reference/metaprogramming/inline.html http://dotty.epfl.ch/docs/reference/metaprogramming/inline.h...
But it's there for meta-programming purposes, not micro-optimizations. I don't think trying to outsmart the JVM at inlining is worth it.
- kjaer 5y agoThis is correct, though the inline feature does also unlock some optimizations. For instance, see this example from the docs where a recursive method is optimized to a few sequential commands when some of its parameters are constants: http://dotty.epfl.ch/docs/reference/metaprogramming/inline.html#recursive-inline-methods http://dotty.epfl.ch/docs/reference/metaprogramming/inline.h... This effectively makes it possible to have a limited form of partial evaluation.