I have done extensive test on java.lang.Character class. Here are my
conclusions:

1) isWhiteSpace should be isWhitespace

2) readChar should not return null on not-defined characters. There
should be something like:
        if ( block == -1 )      return CharAttr(ch,false,UNASSIGNED,-1,ch,ch);
or we could reuse one CharAttr for every undefined character -
CharAttr(0,false,UNASSIGNED,-1,0,0)

3) There is no need for putting char ch field in CharAttr - it is not
used anywhere

4) There is a lot of errors in implementation - 279 compared to 118 in
JDK. More details later

5) Performance is terrible. Terrible squared. Slower than slow. Here are
the benchmark results
(I know that no real world app use so much Character calls, but it is
worth looking at anyway)

JDK             8136ms
JDK+tya         2212ms
classpath      73920ms
classpath+tya  44391ms

9x longer without jit, 20x longer with jit.

I have done tests on JDK1.1.5 with original libs, or with
Character,Cloneable, VMsomething, and gnu/*/ClassLoaderHelper from
classpath added.


If you want to know exactly what tests are failed, or repeat benchmark
you can download test from
http://www.pg.gda.pl/~abies/tests/CharacterTest.java
Take unicode data from classpath, rename it to UnicodeData.txt and put
in same directory as CharacterTest. Then run with -benchmark or -verbose
flags

Artur

P.S.
This test should go into mauve soon, but first I would like to correct
some places where I'm not sure what behaviour should be considered
normal - look at the errors reported and try to find any which should
not be reported.

Reply via email to