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

CopyOnWriteArrayList backing array access optimization

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      As suggested by Frank Yuan in
      https://openjdk.markmail.org/thread/xgbga25zatb6prks
      it seems worthwhile to optimize access to CopyOnWriteArrayList backing array by using weaker-than-sequential-consistent operations via VarHandle.
      When holding the lock, one can use plain reads and release writes.
      When not holding the lock, one can use acquire reads.
      Someone should write jmh benchmarks to demonstrate improvement.
      On x86, one might only be able to demonstrate improvements on mutations.
      On ppc, one should also be able to demonstrate improvements on read operations.

        Attachments

          Activity

            People

            • Assignee:
              martin Martin Buchholz
              Reporter:
              martin Martin Buchholz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: