Hi folks,

`LinkedList` is used as the underlying data-structure for all core.async buffers. However, looking closer reveals that what is really needed is a `Deque` (for its .addFirst/.removeLast methods). So naturally then it begs the question - why not `ArrayDeque` [1]? It should offer superior insertion/removal/traversing performance, and in the context of core.async it will never be resized (if initialised with `n`).

And since we're on the subject, why not even go crazy with a (thread-safe) `ConcurrentLinkedDeque` [2] ? Leaving the counting complication aside for a moment (something which I wouldn't mind feedback on), having a thread-safe buffer opens up the door to safe buffer snapshots.

Anything wrong with either of those approaches? Many thanks in advance...

Kind regards,

Dimitris

[1]: https://github.com/jimpil/asynctopia/blob/master/src/asynctopia/buffers/array.clj

[2]: https://github.com/jimpil/asynctopia/blob/master/src/asynctopia/buffers/thread_safe.clj


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/f03d8fcd-05a7-b151-a9dc-9a200a9b5d9d%40gmail.com.

Reply via email to