Comments inline.

At 10:32 27.03.2002 -0800, Post, Richard (HQP) wrote:

>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.

Very good point.

>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.

I think the compiler will do it for you. Anyway, it should not matter that 
much.

>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.

The conversion pattern is:

log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{3} %x - 
%m%n

So the output should be tagged. On the other hand, it'll be cool to measure 
the impact
of NDCs, MDCs and Localication info.

>Good benchmark results though!

Definitely. I wonder if on NT the numbers are similar. Ceki

ps: By the way, before I forget, thank you Ole Dalgaard.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to