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

ObjectOutputStream replacement table search is linear

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.1
    • 1.3.0
    • core-libs
    • None
    • ladybird
    • generic
    • generic
    • Verified

        ObjectOutputStream currently records replaced objects (i.e., those which have
        been returned by a call to ObjectOutputStream.replaceObject() or a
        class-defined writeReplace() method) in the object array replaceObjects[]. In
        order to determine whether or not an object has a replacement,
        ObjectOutputStream performs a linear scan of the table (see
        ObjectOutputStream.lookupReplace()). If the number of replaced objects is
        large, the overhead of this search becomes prohibitively expensive--for each
        new object serialized, ObjectOutputStream will scan the entire array for a
        match before concluding that there is none.

        The replacement table should be replaced with a hash table similar to the one
        used for wire handle lookup.

              mwarressunw Michael Warres (Inactive)
              mwarressunw Michael Warres (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: