foca icon indicating copy to clipboard operation
foca copied to clipboard

Lots of CPU time spent sorting broadcast bytes

Open jeromegn opened this issue 1 year ago • 6 comments

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.

jeromegn avatar Oct 14 '22 13:10 jeromegn