Skip to content

cache miss on bounded crossbeam_channel::Receiver try_recv #1163

@boranby

Description

@boranby

Hi,
I don't know whether this is an expected behavior of Atomics but when I run perf on my code I see that there are cache misses on try_recv call. I have a bounded queue, which has 8 senders and 1 receiver. In the sender sides, I couldn't find any notable miss, because of that I raise that issue for the receiver side.
My call:

loop {
    while let Ok(mut messages) = self.parsed_feed_receiver.try_recv() {
        ...
    }
        ...
}
perf stat cache_miss1 cache_miss2

There are other small misses but they are negligible compared to these 3 lines. If you can help to figure this out, I'll appreciate that. Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions