foca
foca copied to clipboard
Lots of CPU time spent sorting broadcast bytes
I'm actually not sure where the time is being spent, but most of the CPU time in my project is currently being used sorting something related to broadcast messages.
Flamegraph: corro.svg.zip
Looks like it goes like this:
-
Foca::broadcast
-
Foca::send_message
-
Broadcasts::fill
-
core::slice::sort::recurse
-
core::slice::sort::partial_insertion_sort
-
PartialOrd::lt
I have a loop that calls Foca::broadcast
every 200ms to ensure maximum gossip propagation of broadcast messages.