Niklas Mehner wrote:

> CPU TIME (ms) BEGIN (total = 431) Thu Jan 10 16:32:28 2002
> rank   self  accum   count trace method
>   3  7,19% 83,76% 2822912  2169 Freenet.crypt.ciphers.Twofish_Algorithm._b

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

>     private static final int _b( int x, int N) {
> -      int result = 0;
> -      switch (N%4) {
> -      case 0: result = b0(x); break;
> -      case 1: result = b1(x); break;
> -      case 2: result = b2(x); break;
> -      case 3: result = b3(x); break;
> -      }
> -      return result;
> +      return (x >>> ((N%4) * 8)) & 0xFF;


This patch makes sense to me (pretty straightforward) and if the savings 
are really that large, I propose that somebody checks it into the 
new_datastore and HEAD branches of CVS. I am al for it...
Any volunteers?

Sebastian






_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl

Reply via email to