https://issues.dlang.org/show_bug.cgi?id=13444
Issue ID: 13444
Summary: std.concurrency.Mailbox should use a ring buffer
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: performance
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: [email protected]
Reporter: [email protected]
The current Mailbox implementation in std.concurency uses a private List
struct where every call to .put() needs to allocate a new node from the GC.
A better alternative is a ring buffer which can do all the things the Mailbox
needs and faster in every way. The growing time can be compensated by a right
call to setMaxMailboxSize() and any random removal can be a swap of the last
element with the one being removed.
Forum link: http://forum.dlang.org/thread/[email protected]
--