rorygraves / scalac_perf

The Scala programming language
http://www.scala-lang.org/
16 stars 3 forks source link

StringInterpolation is slow and inefficient #24

Open mkeskells opened 7 years ago

mkeskells commented 7 years ago

String Interpolation is slow at run time and inefficient code generation, with lots of temporary garbage generated

convert s and raw to macros (like f is already)

generate optimal code

This is mostly a macro writing issue + one line to register the fast path for the macro in FastPath

For the macro structure see FormatInterpolater Probably should improve that code at the same time or in a separate issue

maybe revert or test with https://github.com/rorygraves/scalac_perf/issues/14 as an example

mkeskells commented 7 years ago

first stab https://github.com/rorygraves/scalac_perf/tree/mike/2.12_x_StringInterpolation then https://github.com/scala/scala/pull/6093 for intrinsic version to be followed by macro version

mkeskells commented 7 years ago

PR https://github.com/scala/scala/pull/6041

lrytz commented 6 years ago

https://github.com/scala/scala/pull/6093

mkeskells commented 6 years ago

https://github.com/scala/scala/pull/6093 is merged - ned t confirm the 2.13 plan before we close this issue though. May consider opening a similar issue for f"", for some simple cases

mkeskells commented 6 years ago

@retronym - has the macro version of this been merged into 2.13.x?

retronym commented 6 years ago

Nope. It is tracked as https://github.com/scala/scala-dev/issues/475.