Scala 2 forwardport: `-Yprofile-trace`
- Scala 2 tracing profiler backport from https://github.com/scala/scala/pull/7364 extended with more Scala 3 idiomatic syntax based on inlined methods
- Fixes the
context.profilerwhich could have beennull, now it's initially a NoOp Profiler - Check dependencies of
-Yprofile-enableddependent tasks, now we get an error if-Yprofile-traceis set without-Yprofile-enabled
@keynmol petition here
YES YES YES PLEASE This would be so much better than the several formats currently enabled by 3 different flags
@nicolasstucki I think you we're doing the original backport of Profiler from Scala 2. Can you take a look at this and make a review?
I generated the profile for
enum Foo:
case A
case B
case C
and got the following result
All metrics (except for GC) are missing in the type phase.
The metrics are collected after the CompilationUnit with at least 10ms intervals. Parser used overriden runOn method that didn't run onUnit callback. Becouse there was only 1 compilation unit it seemed like collection of metrics started after the typer. In fact it works the same in Scala 2, but I've fixed to collect initial results in the constructor of the profiler - now we got statistics from the very beginning of the compilation run
I needed to rebase the PR which is not good news for the reviewing. The improvements after the first review round start with https://github.com/scala/scala3/pull/19897/commits/592a892f245133053c548f73dd5e4c1d636770a4
test performance please
performance test scheduled: 1 job(s) in queue, 1 running.
Performance test finished successfully:
Visit https://dotty-bench.epfl.ch/19897/ to see the changes.
Benchmarks is based on merging with main (3097a84d0a)