Rewrite of IBM doublebyte charsets (original) (raw)

Ulf Zibis Ulf.Zibis at gmx.de
Tue May 19 10:02:51 UTC 2009


Am 19.05.2009 09:19, Xueming Shen schrieb:

I will try the b2c[0x100][] idea to see the performance...I actually tried b2cIndex[0x100] + b2c[], which did not bring me the performance I expected, but that was a long time ago, so this time might be different:-)

Even if there is no performance gain, the code will become more readable, and initC2B becomes more simple. Additionally, when doing research on the generated source files (e.g. visual diff between different charsets), interpretation of the data becomes much more simple, as there would be exactly 1 String element for 1 mapping segment, always starting at it's b2Min value as first left value of each chunk. With that help, if would be easy to discover similar mapping for later tuning regarding sharing maps partly. :-)

Don't forget to try char c = b2cStr[byte1].charAt(byte2); , using String[] b2cStr = new String[0x100]; , to avoid copying String[] to char[][].

-Ulf



More information about the core-libs-dev mailing list