Skip to content

Speedup CPU time of channel.WritePacketMsgTo #2951

@ValarDragon

Description

@ValarDragon

Feature Request

Summary

Whenever we want to send a packet, we spend a considerable amount of time in CPU overheads (that are actually under the flowrate limitation, and thereby hurting throughput). When its time to send, we have to spend awhile:

  • re-encoding data
  • doing proto marshalling
  • allocating buffers

image

This time is all under flow-rate limitation and a single threaded bottleneck for communicating to this peer (as far as I understand)

Time delays

If we look at the time here, there is a few parts:

Re: The triple wrapping problem. It seems this is something we can backwards compatibly speedup with some "hand rolled" mimicking the proto-encoding tricks, or having less heap allocations. Neither feels elegant right now though. I hope other people have better solutions. Longer term, ideally we just don't triple wrap.

For the new internal buffer per packet, ideally we can just make the channel use the already allocated protowriter that exists in sendRoutine?

There are other flow rate problems that aren't part of this, but I leave that to another github issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions