You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Ceki Gülcü <ce...@qos.ch> on 2002/03/27 23:56:08 UTC

Fwd: RE: Serialization performance - question re location of log.join in LogTest.java file

Forwarding for info.

>Delivered-To: cgu@qos.ch
>X-Server-Uuid: cdced086-966c-11d3-b153-00c0f02de454
>From: "Post, Richard (HQP)" <Ri...@rhi.com>
>To: "'josua+log4j@giraffen.dk'" <jo...@giraffen.dk>
>Cc: "'ceki@qos.ch'" <ce...@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
>
>Hi,
>
>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!
>
>Rick


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>