measurement - Measure execution time of Java with JVMTI -


for profiler implement using jvmti start measuring execution time of java methods. jvmti offers events:

  • methodentry
  • methodexit

so quite easy implement, came across note in api:

enabling method entry or exit events degrade performance on many platforms , not advised performance critical usage (such profiling). bytecode instrumentation should used in these cases.

but profiling agent works headless, means collected data serialized , sent via socket server application displaying results. how should realize using byte code instrumentation. kind of confused how go on here. explain me, if have switch strategy or how can approach problem?

i don't know sun jvm ibm jvm goes call fullspeeddebug mode when request methodentry/exit events.... fsd slows down execution quite bit.

as can use bci profiler unless selective methods instrument see slow down. example profiler inserts if(profiling) callprofilerhook() on every entry , of possible exits in method object creates , other areas well.... these additional checks can slow down execution on 50%...

as how bci... wrote own c library it... it's technically not hard (hint delete stackmaptable) may take while.. alternatively can use asm et. al.

finally... callbackhook add overhead , on small methods render reported cpu/clock time meaningless unless perform sophisticated overhead calculation... if callback code affects shape of processor l1 caches , java code becomes less efficient because has less room..

my profiler ignores reported times visualize execution in interesting way... i'm looking understand flow of of code, in fact in cases code running (most java projects have no idea of millions on lines of third-party code running in app)


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -