Packet
package, which efficiently recycles the byte buffers
that are used throughout Frisbee to hold interstitial data. These make use of the polyglot library
to implement Encoding
and Decoding
packages, which read and write directly from the Packet.packet
structure. By recycling the Packet.packet
structures throughout Frisbee, we can significantly reduce
the number of allocations in the encoding and decoding functions.
Most of our other optimizations center around our network I/O. Actually reading and writing data from a TCP socket
is extremely slow, and so Frisbee makes an effort to maximize the amount of data that we read or write to a TCP socket
while avoiding any additional latency.
All these optimizations - as well as Frisbee’s architecture, make it feasible to use Frisbee (as well as fRPC)
in both latency-sensitive applications like in real-time streaming, as well as high-throughput applications like PUB/SUB systems.