#13 see if we can get rid of the message Arc in client

Closed
opened 1 year ago by j3tracey · 1 comments

In the name of code reuse with peer mode, we put the messages in the channel between the state machine and the writer thread in an Arc. There's nothing wrong with this for correctness, but since a message only ever gets sent over one connection from the client, it's strictly overhead, and as a synchronization primitive, it forces cache coherence across NUMA nodes, which can be a major hit for performance (not that we won't be using tons of synchronization primitives anyway). We should see if there's an easy way to preserve code reuse while getting rid of this, likely through generics.

In the name of code reuse with peer mode, we put the messages in [the channel between the state machine and the writer thread](https://git-crysp.uwaterloo.ca/j3tracey/MGen/src/a77581b348197a48442afb1e2919749aa56060f3/src/bin/client.rs#L27) in an [Arc](https://doc.rust-lang.org/std/sync/struct.Arc.html). There's nothing wrong with this for correctness, but since a message only ever gets sent over one connection from the client, it's strictly overhead, and as a synchronization primitive, it forces cache coherence across NUMA nodes, which can be a major hit for performance (not that we won't be using tons of synchronization primitives anyway). We should see if there's an easy way to preserve code reuse while getting rid of this, likely through generics.
Justin Tracey commented 1 year ago
Owner

Fixed via 1d900f96b3

Fixed via 1d900f96b3
Sign in to join this conversation.
No Milestone
No assignee
1 Participants
Loading...
Cancel
Save
There is no content yet.