Bug 13444 – std.concurrency.Mailbox should use a ring buffer

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-09T13:41:50Z
Last change time
2024-12-01T16:22:19Z
Keywords
performance
Assigned to
Sean Kelly
Creator
badlink
Moved to GitHub: phobos#9640 →

Comments

Comment #0 by andrea.9940 — 2014-09-09T13:41:50Z
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]
Comment #1 by robert.schadek — 2024-12-01T16:22:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9640 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB