-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b39
-
generic
-
generic
java.lang.Class currently has the following static field initialization:
private static final ObjectStreamField[] serialPersistentFields =
ObjectStreamClass.NO_FIELDS;
which causes initialization of java.io.ObjectStreamClass (NO_FIELDS is not a constant field)-- but ObjectStreamClass.NO_FIELDS is simply a convenience value of an empty java.io.ObjectStreamField array; as far as serialization is concerned, it would be semantically equivalent for the above to instead be this:
private static final ObjectStreamField[] serialPersistentFields =
new ObjectStreamField[0];
and that wouldn't cause initialization of ObjectStreamClass-- only ObjectStreamField, which is comparatively small and has very few initialization dependencies. Removing this dependency on ObjectStreamClass intialization could have a couple of benefits:
- faster VM bootstrap initialization sequence, if only incrementally
- simplification, again if only incrementally, of the delicate, tangled web of class initialization dependencies exercised during the VM bootstrap initialization sequence (see Comments for an example of the fragility)
Note that the same change was made for java.lang.String in 1.3 as part of a performance effort (4230112), but for some reason it wasn't done for java.lang.Class at the time.
###@###.### 2005-05-17 02:11:24 GMT
private static final ObjectStreamField[] serialPersistentFields =
ObjectStreamClass.NO_FIELDS;
which causes initialization of java.io.ObjectStreamClass (NO_FIELDS is not a constant field)-- but ObjectStreamClass.NO_FIELDS is simply a convenience value of an empty java.io.ObjectStreamField array; as far as serialization is concerned, it would be semantically equivalent for the above to instead be this:
private static final ObjectStreamField[] serialPersistentFields =
new ObjectStreamField[0];
and that wouldn't cause initialization of ObjectStreamClass-- only ObjectStreamField, which is comparatively small and has very few initialization dependencies. Removing this dependency on ObjectStreamClass intialization could have a couple of benefits:
- faster VM bootstrap initialization sequence, if only incrementally
- simplification, again if only incrementally, of the delicate, tangled web of class initialization dependencies exercised during the VM bootstrap initialization sequence (see Comments for an example of the fragility)
Note that the same change was made for java.lang.String in 1.3 as part of a performance effort (4230112), but for some reason it wasn't done for java.lang.Class at the time.
###@###.### 2005-05-17 02:11:24 GMT