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

improve static cache performance by using ConcurrentHashMap

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • core-libs

        From http://www.theserverside.com/news/thread.tss?thread_id=25538:

        > I ran into scalability problems with Object streams when writing a custom
        > transport for JBoss. It boils down to some static variables being
        > synchronized within java.io.ObjectStreamClass
        >
        > /** cache mapping local classes -> descriptors */
        > private static final SoftCache localDescs = new SoftCache(10);
        > /** cache mapping field group/local desc pairs -> field reflectors */
        > private static final SoftCache reflectors = new SoftCache(10);
        >
        > I walked through some hoops to change the use of SoftCache to a
        > ConcurrentReaderHashMap and throughput started increasing 20-40% depending on
        > how many threads you run through

        Now that ConcurrentHashMap is part of the JDK, this change can be considered
        for serialization.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: