RFR: 8281195: Mistakenly used logging causes significant overhead in interpreter [v2]
Alexey Pavlyutkin
duke at openjdk.java.net
Mon Feb 7 19:38:10 UTC 2022
On Mon, 7 Feb 2022 19:01:38 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Alexey Pavlyutkin has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fixing per review
>
> src/hotspot/share/interpreter/oopMapCache.cpp line 282:
>
>> 280: LogStream st(Log(interpreter, oopmap)::trace());
>> 281:
>> 282: if (log) st.print("Locals (%d): ", max_locals);
>
> This seems unfortunate to have these if statements, and a counter goal of the logging framework. Is there another way to do this without the if statements?
The problem is that here we use multiple print()/cr() statements to make up a single log message, thus we cannot simply use regular log_trace(). The only obvious way to avoid multiple if statements is to quote whole body with one if and introduce else branch without logging. But as I understand the intention of LogStream is exactly to combine a log message as a combination of pieces, so I don't see any problem here
-------------
PR: https://git.openjdk.java.net/jdk/pull/7367
More information about the hotspot-runtime-dev
mailing list