grpc-mqtt
grpc-mqtt copied to clipboard
Perform packet serialization in place.
This PR changes Network.MQTT.GRPC.Message.Packet
so that the same proto3-wire
serialization buffer is reused after each packet is publish. This significantly reduces the maximum heap residency accumulated in the process of splitting a larger message into packets that are individually published.
Related:
- Builds off previous changes #43, #37, and #42 improving performance and memory usage for packet publishes.
- Depends on changes to
proto3-wire
exposing internal functions that were needed.
The previous heap profile obtained from cabal v2-test --test-options "-p \"LongBytes\""
after the changes introduced by #42:
The new heap profile running the same "LongBytes" test: