Skip to content

Experiment with unbounded channel types that do less allocation #8568

Closed

Description

@brson

The current implementation of Chan and Port use a very simple strategy based on an atomic linked list. The implementation is alluringly simple but it requires an allocation on every send and benchmark profiles show these allocations at the top.

Let's evaluate other options.

Activity

  1. huonw commented on Aug 18, 2013

    @huonw
    Contributor

    I'd guess that (an atomic version of) extra::ringbuf would be a way to handle this.

  2. huonw commented on Aug 30, 2013

    @huonw
    Contributor

    Google turns up http://www.cs.tau.ac.il/~adamx/ppopp2013-x86queues.pdf ("Fast Concurrent Queues for x86 Processors" Morrison & Afek 2013), and that seems to suggest there aren't [m]any other array-based unbounded concurrent queues.

  3. brson commented on Oct 26, 2013

    @brson
    ContributorAuthor

    We could also experiment with the queue added in #9710. It is surely faster than the existing channels.

  4. alexcrichton commented on Dec 17, 2013

    @alexcrichton
    Member

    Closing. I've implemented an unbounded queue for Chan types which amortized doesn't perform allocations. We'd still need to do some work on SharedChan, but it's clear that avoiding allocations is a huge win here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions