Skip to content

channels transmit protobuf messages (binary) - #1001

Merged
Keksoj merged 1 commit into
transmit-protobuf-onlyfrom
channel-transmit-prost-messages
Oct 13, 2023
Merged

Keksoj merged 1 commit into
transmit-protobuf-onlyfrom
channel-transmit-prost-messages

Conversation

@Keksoj

@Keksoj Keksoj commented Oct 13, 2023 •

Copy link
Copy Markdown

This is the last step in the implementation of protobuf in Sōzu: use protobuf for all communications of Sōzu, within and without. See #1000

Coded with @Wonshtrum , this PR:

  • makes channel transmit protobuf messages
  • in a binary serialization
  • with a fixed-size delimiter that tells how long the message is

Here is a simple benchmark of performance improvements:

We will serialize, write in a buffer, read from the buffer and deserialize, a 1000000 times, this object:
RequestHttpFrontend { cluster_id: Some("cluster_1"), address: "127.0.0.1:8080", hostname: "lolcatho.st", path: PathRule { kind: Prefix, value: "/" }, method: Some("GET"), position: Tree, tags: {"app_id": "a782f2e4-ee42-4384-9757-2b13d4198105", "owner": "Clever Cloud"} }
serde_json serialized it in 216 bytes
Serde JSON needed 23.838388363s
prost serialized it in 125 bytes
Prost needed 12.118231414s

@Keksoj Keksoj added this to the v0.16.0 milestone Oct 13, 2023
@Keksoj Keksoj self-assigned this Oct 13, 2023
@Keksoj
Keksoj merged commit b792240 into transmit-protobuf-only Oct 13, 2023
@Keksoj
Keksoj deleted the channel-transmit-prost-messages branch October 25, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant