Add `@Stable` to BigInteger and BigDecimal

2025-05-27 Thread wenshao
Some final arrays of BigInteger and BigDecimal are stable and immutable. We should add `@Stable` to give the optimizer more information - Shaojin Wen

Add @Stable to BigInteger and BigDecimal

2025-05-25 Thread wenshao
Some static final arrays of BigInteger and BigDecimal are stable and immutable. We should add @Stable to give the optimizer more information - Shaojin Wen

Add @Stable to java.lang.CharacterDataLatin1 and other CharacterData classes

2025-05-24 Thread wenshao
Classes such as java.lang.CharacterDataXXX have multiple static final arrays, which will not be modified. We should add @Stable to provide information to the optimizer. such as ```java class CharacterData00 { @Stable static final char[] X = @Stable static final char[] Y = @Stable static final int

Integer::digits should be defined as byte[]

2025-05-23 Thread wenshao
Now Integer/Long uses Integer::digits to convert to byte, so we should define Integer::digits as byte[], which can avoid the conversion. - Shaojin Wen

DigitList::toString method causing incorrect results during debugging

2025-05-23 Thread wenshao
When debugging getLong/getDouble/getDecimal of java.text.DigitList, the debugger will call the DigitList::toString method. At this time, DigitList::toString will modify tempBuilder, which will cause incorrect results. - Shaojin Wen

C2 inlining failed because the String constructor is too large

2025-05-18 Thread wenshao
Through JVM Option +PrintInlining, we found that String has a constructor codeSize of 852, which is too large. This caused failed to inline. The following is the output information of PrintInlining: ``` @ 9 java.lang.String:: (12 bytes) inline (hot) !m @ 1 java.nio.charset.Charset::defaultCharset

回复:Towards a JSON API for the JDK

2025-05-16 Thread wenshao
As the author of a popular json library (fastjson/fastjson2), I think the current design is not good, not easy to use, and the performance is not good. The JsonNull/JsonNumber/JsonString/JsonValue here should not be designed like this, which will cause trouble to users and affect performance. For

回复:RFD: Can we remove the deprecated internal Unsafe *Object* methods?

2024-03-06 Thread wenshao
Many libraries use Unsafe to improve performance, especially in many performance-critical scenarios of big data, such as Apache Flink/Apache Arrow, etc. Direct removal will make it difficult to adopt the new version of JDK. It is recommended to use it similar to JEP 396, which needs to be opened