Performance costs of untriggered UL log points?

Thomas Stüfe thomas.stuefe at gmail.com
Wed Feb 7 16:23:42 UTC 2018


Hi guys,

short question, when creating UL, did anyone measure what an untriggered
instrumentation point does cost?

I was the other day comparing performance of a patch of mine with the
unpatched jdk. To my dismay my patched version was consistently ~5-10%
slower. But I had logging points in that function, for example:

1865 log_trace(gc, metaspace, freelist)("Coalescation (%s): created
coalesced chunk at %p, size " SIZE_FORMAT_HEX ".",
1866                (is_class() ? "class space" : "metaspace"),
1867                 p_new_chunk, p_new_chunk->word_size() *
sizeof(MetaWord));

The function did run ~3000 times during my test - so not an indecent amount
of times, but something which one might conceivably want to do. Logging was
switched off. I found that commenting out this log line would make the
difference to the unpatched jdk disappear (runtime went down from ~90ms to
~80ms).

Of course I am happy that my patch is performing well after all, but I am
surprised too. I would have naively assumed that tracing not switched on
costs next to nothing.

I am aware that one needs to access some global information in order to
find out the current tracing level, but maybe there is still room for
improvement?

In our port we have a very old and simple tracing system which is triggered
by a simple global bit array. Accessing that is quite cheap, at least I
never noticed any negative effects like described above.

Kind Regards, Thomas


More information about the hotspot-runtime-dev mailing list