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

Create ObjectStreamField signature lazily when possible

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: core-libs

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: