This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java.lang.Character


Eric Blake wrote:

>So, my end target is to have the end algorithms and behavior match,
>although the database interface will differ between the two projects. 
>
Cool.

>Actually, I do have one more question on efficiency:
>In the Classpath version, the 2nd level lookup occupies up 5800+
>characters, although there are about only 350 unique character
>attributes (so 9 bits are required to index into a 3rd level).  As a
>result, there are four 3rd level tables for the attributes that did not
>fit in the 7 otherwise unused bits of the 2nd level lookup.
>
>Is it better to have multiple 2nd level tables, at the expense of more
>memory; or to use 3rd level tables, at the cost of another level of
>array lookups?
>

My guess is that it will be better to go for whichever has the smallest 
(and most "dense") tables. The cost of an extra level of lookup will be 
more than offset if can reduce the likelyhood of cache misses. Its also 
worth considering that the Unicode people are dreaming up new characters 
all the time, so I guess having three levels will scale better?

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]