RFR: 8359119: Change Charset to use StableValue [v2]
Per Minborg
pminborg at openjdk.org
Tue Aug 5 09:32:05 UTC 2025
On Sun, 20 Jul 2025 22:14:37 GMT, Shaojin Wen <swen at openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - Revert for loop
>> - Revert more
>> - Revert changes
>
> After this proposal, the startup will load 9 more classes
>
> * Java Code
>
> public class Startup {
> public static void main(String[] args) throws Exception {
> Thread.sleep(1000);
> }
> }
>
>
>
> ./build/macosx-aarch64-server-release/images/jdk/bin/java -verbose:class Startup
>
>
> By comparing the output before and after this proposal, we can see that 9 more classes are loaded, as follows:
>
> [info][class,load] java.nio.charset.Charset$2
> [info][class,load] java.lang.StableValue
> [info][class,load] java.util.Objects
> [info][class,load] jdk.internal.lang.stable.StableSupplier
> [info][class,load] jdk.internal.lang.stable.StableValueImpl
> [info][class,load] java.nio.charset.Charset$3
> [info][class,load] java.nio.charset.Charset$4
> [info][class,load] java.nio.charset.Charset$5
> [info][class,load] jdk.internal.ref.Cleaner
After the most recent updates, here is what I see if I run the `Startup` code by @wenshao (comparing with main line JDK 26):
[0.017s][info][class,load] java.lang.ScopedValue source: shared objects file
[0.017s][info][class,load] java.lang.ScopedValue$Cache source: shared objects file
[0.017s][info][class,load] java.nio.charset.Charset$3 source: shared objects file
[0.017s][info][class,load] java.nio.charset.Charset$4 source: shared objects file
[0.017s][info][class,load] java.nio.charset.Charset$5 source: shared objects file
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25727#issuecomment-3154291506
More information about the nio-dev
mailing list