|
With 5 threads, a file logger with buffering turned on, running on a 650MHz PIII Coppermine Sony Vaio laptop running RedHat Linux 7.2, kernel 2.4.9, I saw these results:
Virtual Machine | Syslog.log() time per call |
Calls per second |
---|---|---|
Classic VM (build JDK-1.2.2_012, green threads, nojit) |
233.9 μs | 4,276 |
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_03-b03) |
44.0 μs | 22,742 |
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode) |
36.9 μs | 27,086 |
JRockit Virtual Machine (build 3.1.4-dax.appeal.se-20030319-1000) Native Threads, Generational Concurrent Garbage Collector |
31.1 μs | 32,109 |
Classic VM (build 1.3.1, J2RE 1.3.1 IBM build cxia32131-20030410 (JIT enabled: jitc)) |
17.3 μs | 57,844 |
With the Syslog.setComputeCaller() option set to true, the performance looks like this:
Virtual Machine | Syslog.log() time per call |
Calls per second |
---|---|---|
Classic VM (build JDK-1.2.2_012, green threads, nojit) |
1,242 μs | 805 |
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_03-b03) |
309 μs | 3,242 |
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode) |
197 μs | 5,079 |
JRockit Virtual Machine (build 3.1.4-dax.appeal.se-20030319-1000) Native Threads, Generational Concurrent Garbage Collector |
249 μs | 4,011 |
Classic VM (build 1.3.1, J2RE 1.3.1 IBM build cxia32131-20030410 (JIT enabled: jitc)) |
unknown μs | unknown |
Interestingly, the IBM JDK deadlocked while trying to create new instances of java.lang.Throwable in rapid succession (either single-threaded or multi-threaded). Suffice it to say that the StackTraceUtil.whereAmI() method can be a very slow operation, though very useful for debugging.