RFR: 8215159: Improve initial setup of system Properties
Roger Riggs
Roger.Riggs at oracle.com
Tue Dec 11 18:08:01 UTC 2018
Hi Claes,
SystemProps.java:
- the import of Collections isn't used.
VM.java:
- line 180: The savedProps doesn't need to be (and was not
previously) unmodifiable.
Seems safer this way though since the map at the bottom is not
ConcurrentHashMap.
Its not entirely clear who calls getSavedProperties().
Would it be more efficient for savedProps to be the unmodifiable map
and not create
one on every call to getSavedProperties.
VersionProps.java.template:
- The version properties don't need to be in the savedProps map and
could be put only in the Properties.
(save a few cycles and entries).
System.java:
- swap lines 805/806 if you decide not to put version props in the map.
- and call VerionProps.init() after the call to createProperties().
Regards, Roger
On 12/11/2018 12:41 PM, Mandy Chung wrote:
>
>
> On 12/10/18 1:17 PM, Claes Redestad wrote:
>> Hi,
>>
>> by inverting the order in which the internal property maps are created,
>> we avoid some classloading and get a slightly more efficient code
>> execution profile in System.initPhase1.
>>
>> Webrev: http://cr.openjdk.java.net/~redestad/8215159/jdk.00/
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8215159
>>
>
> This change looks okay to me.
>
> ModuleBootstrap also removes some `jdk.module.*` private system
> properties during
> module system initialization but they are only set if module-related
> command-line
> options are set. These properties are not present in the common
> cases. These
> private system properties are the interface between VM and
> libraries. There is
> other mechanism that we can look into to replace using system
> properties in the
> future.
>
> Mandy
More information about the core-libs-dev
mailing list