4 ms·
Sampling profilers in general are terrible. Unfortunately I can't get code instrumenting profilers to work on the eclipse process. The worst thing about the JV
by imtringued 11y ago
Sampling profilers in general are terrible. Unfortunately I can't get code instrumenting profilers to work on the eclipse process.
The worst thing about the JVM aprofiler won't tell you about how much time the JVM spends JITing/class loading. For short running processes you might be surprised to find that the profiler tells you everything is okay but in my case the program still needed one second to start.
I was pleasantly suprised that the equivalent python programm merely needs 100ms from start to finish (essentially feeling instant) even though it should be slower overall.
- sevenseconds 11y agojstat can tell you how much time your jvm is spending jiting/classloading ... http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html#class_option http://docs.oracle.com/javase/7/docs/technotes/tools/share/j...
- barrkel 11y agoInstrumenting profilers are also terrible because they make tiny methods look way more expensive than they should be, warping the results. Not only does the instrumentation cost, but they can prevent methods from being inlined, interfere with optimizations, cache, and generally give misleading results. For a sampling profiler to give meaningful results, it shouldn't be waiting for safepoints. Ideally it would capture stack traces very cheaply (just walk the stack frames, noting the return addresses) and turn those numbers into symbolic locations on its own time. Yes, inlining is going to confuse things - that's the downside of working with optimized code. Optimization inherently intermingles code that may be separated by some distance, and any one instruction may be a fuse of multiple source lines. If your instrumenting profiler prevents this, you're no longer measuring the actual production code. Java makes it harder, of course, with code on a GC'd heap, dynamic codegen, etc.
- aardvark179 11y agojstat or Java Flight Recorder/Mission Control will give you plenty of info on class loading, JITing, GC, and almost everything else going on in the VM, and there are plugins fort VisualVM which will provide a lot of the same information.