Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8184603

Create ObjectStreamField signature lazily when possible

XMLWordPrintable

      There's a small startup cost associated with private static final ObjectStreamField[] serialPersistentFields, most of which boils down to the fact that the constructor creates and interns a String corresponding to the field's class signature. By making this process lazy we can achieve a small startup gain on a variety of applications.

      The most straightforward way of safely doing this lazily would involve making the final signature field lazy, which could have negative performance implications - but analysis shows that the signature field itself is not read during hot paths in serialization (only during one-off setup steps), so this should have no measurable impact on overall serialization performance.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: