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

Use ArrayDeque instead of LinkedList for queue implementation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • Backlog
    • None

    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

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

            Dates

              Created:
              Updated: