Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3095

Use ArrayDeque instead of LinkedList for queue implementation

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:

      Description

      Use ArrayDeque instead of LinkedList for queue implementation where thread safety is not needed.

      From https://docs.oracle.com/javase/7/docs/api/java/util/ArrayDeque.html

      Resizable-array implementation of the Deque interface. Array deques have no capacity restrictions; they grow as necessary to support usage. They are not thread-safe; in the absence of external synchronization, they do not support concurrent access by multiple threads. Null elements are prohibited. This class is likely to be faster than Stack when used as a stack, and faster than LinkedList when used as a queue.

        Attachments

          Activity

            People

            • Assignee:
              liukaige Kaige Liu
              Reporter:
              yuzhihong@gmail.com Ted Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: