RFR: 8255746: Make PrintCompilation available on a per method level

Christian Hagedorn chagedorn at openjdk.org
Wed Oct 12 15:32:05 UTC 2022


On Wed, 12 Oct 2022 13:21:38 GMT, Joshua Cao <duke at openjdk.org> wrote:

>> src/hotspot/share/compiler/compileBroker.cpp line 2138:
>> 
>>> 2136:     task->print_tty();
>>> 2137:   }
>>> 2138:   elapsedTimer time;
>> 
>> Shouldn't this timer start at the very top of the method? Printing needs time but it kinda adds to the compilation time, so it's probably not wrong to count that time as well when explicitly using print flags.
>
> I've kept it this way because the timer was started after printing prior to this change as well. If a dev is benchmarking compilation time, it is better to not include the timer. Printing adds noise that is not there during real-world runs.

Okay, I don't have a strong opinion about it. In the old code, we somehow did it in-between: We printed UL, then with `PrintCompilation`, then started the timer and then printed to `CompilationLog::log()`. So, I'm not sure what the original intention was. Maybe someone else can comment on that, too.

-------------

PR: https://git.openjdk.org/jdk/pull/10668


More information about the hotspot-compiler-dev mailing list