Hi!

I just did some profiling on freenet startup time and got the following 
results:
(using java -server -Xbatch -Xmx200M -Xrunhprof:cpu=times,heap=sites 
Freenet.node.Node)

CPU TIME (ms) BEGIN (total = 431) Thu Jan 10 16:32:28 2002
rank   self  accum   count trace method
   1 49,42% 49,42%       6  1937 java.lang.Object.wait
   2 27,15% 76,57%    1140  2161 java.lang.Thread.sleep
   3  7,19% 83,76% 2822912  2169 Freenet.crypt.ciphers.Twofish_Algorithm._b
   4  4,41% 88,17%  705728  2175 
Freenet.crypt.ciphers.Twofish_Algorithm.Fe32
   5  0,93% 89,10%  705728  2172 Freenet.crypt.ciphers.Twofish_Algorithm.b1
   6  0,93% 90,02%   22054  2171 
Freenet.crypt.ciphers.Twofish_Algorithm.blockEncrypt
   7  0,93% 90,95%  705728  2170 Freenet.crypt.ciphers.Twofish_Algorithm.b2
   8  0,70% 91,65%    6840  2381 
Freenet.support.io.ReadInputStream.readToEOF
   9  0,70% 92,34%   13440  2790 java.lang.Integer.parseInt
   ....

Since I did not want to optimize wait() or sleep() I looked at _b() a 
small patch.
This improves the _b() performance by about 25% (should be about 5-10% 
for the whole startup process).
I have attached a test case and the patch. So if you like it, feel free 
to check it in.

Niklas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20020110/f3da100c/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: OptimizationTest.java
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20020110/f3da100c/attachment.ksh>

Reply via email to