Re:Factor is faster than Zig
by otabdeveloper4 on Saturday November 11, 2023 @04:47AM
(#38228843)
Linked lists are necessary when you have structures that can't be moved. Very important in a highly concurrent or lockfree environment.
[ Parent
| on HN ]
How could you use the Rust standard library's linked list for that?
Can't you have a list of pointers instead?
Resizing/deleting items in list in most implementations are either not lock free or not threadsafe
Yeah, but what if you just use smaller lists and point to the next/previous list?
Hold on...
Linked lists aren't either so....?
A deque will usually work just as well in that environment and it will always have better general performance characteristics. There are very few legitimate uses of linked lists.
Re:Factor is faster than Zig
by otabdeveloper4 on Saturday November 11, 2023 @01:25PM
(#38233000)
A deque is a doubly-linked list under the hood.
Re:Factor is faster than Zig
by adgjlsfhk1 on Saturday November 11, 2023 @08:22PM
(#38236344)
Array based deques are very common (and usually much faster). Doubly linked lists are absolutely awful for memory locality.