Am 22.05.2009 01:41, Ulf Zibis schrieb:
Am 21.05.2009 00:22, Xueming Shen schrieb:

Ulf Zibis wrote:

(7) Avoid copying b2cStr to b2c:
   (String#charAt() is fast as char[] access)
  Benefit[7]: increase startup performance for decoder

I tried again last night. char[][] is much faster than the String[] version in both client and server vm. So keep it asis. (this was actually I switched from String[] to char[][])

I'm surprised, because I had in mind from older benchmarks, that char_array[index] had same speed than str.charAt(index) after optimization from hotspot. I also had this results here: https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/array_io_string/src/sun/nio/cs/SingleByteFastDecoder.java?rev=&view=markup


Maybe hotspot doesn't optimize here, because initC2B() only runs once, but later in de/encoder loops .... wouldn't str.charAt(index) be optimized by hotspot to same speed?

-Ulf


Reply via email to