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

(coll) Speed up collection iteration

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 6
    • core-libs
    • b15
    • generic
    • generic
    • Not verified

      Academics like to compare the performance of Java against other
      language frameworks. Due to a lack of creativity, they often pick
      collection iteration as a particularly interesting number. E.g. here
      is one article where ArrayList iteration makes a particulary poor showing.

      http://www.cs.cornell.edu/andru/papers/jmatch2.pdf

      By specializing the Vector and ArrayList iterators, we can achieve up to
      a factor of two performance improvement with -client; somewhat less with -server.
      The Vector iterator only needs to synchronize in next(), not in hasNext().
      The ArrayList iterator suffers due to the polymorphic virtual call to get() in next()
      that hotspot is known to have troubles with.

      This performance improvement is quite important.

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: