RFR: 8316581: Improve performance of Symbol::print_value_on()

Coleen Phillimore coleenp at openjdk.org
Wed Sep 20 12:46:44 UTC 2023


On Wed, 20 Sep 2023 09:34:05 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this (hopefully correct) optimization of `Symbol::print_value_on()`; investigation into class unloading time distribution showed that a lot of time is spent in the `UnloadingEventLog::log()` call (25+%, see CR).
> 
> The reason seems to be the use of `outputStream::print()` without any need for formatting.
> 
> This seems to decrease time spent in this logging by almost 10x.
> 
> Testing: hs_err output seems still be the same, GHA
> 
> Thanks,
>   Thomas

src/hotspot/share/oops/symbol.cpp line 392:

> 390: // disassembler and error reporting.
> 391: void Symbol::print_value_on(outputStream* st) const {
> 392:   st->write("'", 1);

I haven't seen code using the 'write' function of ostream, but usually print_raw.  Can you use that instead?  print_raw just calls write.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15838#discussion_r1331574246


More information about the hotspot-dev mailing list