nimbus-eth2 icon indicating copy to clipboard operation
nimbus-eth2 copied to clipboard

Offload attestation signature deserialzation to taskpool

Open arnetheduck opened this issue 2 years ago • 0 comments

Loading the serialized signature in attestation currently makes up around 15-20% of CPU usage on the main thread - since the taskpool has become async, we could offload the loading as well so that it's performed together with verification on the task thread instead of doing it on the main thread - this would leave more time in the main thread to deal with other matters better balancing resource usage when running in multithreaded mode.

The flame graph below shows what the main thread is up to - there are roughly 4 hotspots roughly in order:

  • message encoding / decoding (protobuf, libp2 etc)
  • attestation signature deserialization
  • logging (chronicles does a lot of memory allocs/deallocs at debug level) - this goes away on INF
  • consensus stuff, ie aggregating attestations

image

Notably, this is a subscribe-all-subnets node which does an unnaturally high amount of traffic in - it is interesting but not the only way to look at perf.

arnetheduck avatar Sep 20 '23 12:09 arnetheduck