logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Fwd: RE: Serialization performance - question re location of log.join in LogTest.java file
Date Wed, 27 Mar 2002 22:56:08 GMT

Forwarding for info.

>Delivered-To: cgu@qos.ch
>X-Server-Uuid: cdced086-966c-11d3-b153-00c0f02de454
>From: "Post, Richard (HQP)" <Richard.Post@rhi.com>
>To: "'josua+log4j@giraffen.dk'" <josua+log4j@giraffen.dk>
>Cc: "'ceki@qos.ch'" <ceki@qos.ch>
>Subject: RE: Serialization performance - question re location of
>  log.join in LogTest.java file
>Date: Wed, 27 Mar 2002 10:32:03 -0800
>X-Mailer: Internet Mail Service (5.5.2653.19)
>X-WSS-ID: 10BCCFA01700324-01-02
>I have a question about the LogTest.java file that you used for your 
>performance measurements.
>I noticed that the 'log.join()' statement at line 50 is outside the 'for' 
>loop (lines 44-47) that creates the threads for each benchmark.
>Doesn't the 'log.join()' statement cause the code to wait until the 'log' 
>thread dies before continuing?
>If so, then this code will wait until the last thread created in the 'for' 
>loop (44-47) dies; this is because each thread created is used to populate 
>the 'log' variable. Thus when the 'for' loop ends the 'log' variable will 
>represent the last (3rd in this case) thread created.
>There is nothing to guarantee that the last thread created will be the 
>last thread to die. I have run tests where the last thread created is 
>often the first thread to die; it acts like the last thread monopolizes 
>the PC (NT Workstation in my case) and runs to completion.
>If the last thread is not the last to die then the code in LogTest.java 
>that calculates the 'msec:' and 'Logs/sec:' times will not necessarily 
>include all of the events.
>Just a couple of side notes:
>1) Since the value '15001*1000.0' in line 56 is a constant the value could 
>be stored in a variable prior to both 'for' loops and not calculated each time.
>2) It does not appear that the 'logger' statements in the 'run' method in 
>the 'LogTester' class make any distinction as to which thread they are 
>being logged from. It might be helpful to 'tag' each statement with the 
>thread id to make it easier to verify which entries in the log file where 
>logged by which iteration of which thread.
>Good benchmark results though!

To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message