4 ms·
Both the syntax and the semantics are awful. They are overthinking it. Processor should not require to allocate a list of objects do to string templating. Only
by _old_dude_ 3y ago
Both the syntax and the semantics are awful. They are overthinking it.
Processor should not require to allocate a list of objects do to string templating. Only STR and FMT get good perf because they are specialized by the compiler.
- usrusr 3y agoAbout time java introduced escape analysis /s
- _old_dude_ 3y agoSadly escape analysis in Java is weak. In this case, it only works if all the template values do not escape.
- neonsunset 3y agoDoes not allocate a list of objects in C# :) (there is an intermediate pooled buffer, which is then collected to a newly allocated string of an exact size)
- pron 3y ago> Only STR and FMT get good perf because they are specialized by the compiler. Sort of. The specialisation happens for any user of MethodHandle.invokeExact, which is what those processors use (i.e. the compiler doesn't specifically know about STR and FMT), it's just that the MethodHandle API for template processors is not yet public. I expect it will be made public later on.