Benchmarks of the Ergo Framework 3.0 (and above)

March 27, 2026 ยท View on GitHub

Gitbook Documentation MIT license Telegram Community Twitter Reddit

Benchmarks of the Ergo Framework 3.0 (and above)

The tests below are performed on the Apple M4 Max

Ping

Performs 4 scenarios:

  • 1 process spawns 'pong'-process locally and sends 3M messages
  • N processes spawn 'pong'-process locally and send 1M messages (N = number of CPU)
  • 1 process spawns 'pong'-process on a remote node and sends 3M messages
  • N processes spawn 'pong'-process on a remote node and send 1M messages (N = number of CPU)

image

Memory usage (per process)

Performs the following scenario:

  • Takes node information that includes memory usage value.
  • Starts 1M processes
  • Takes node information 3 times with 1s intervals to make sure the GC has freed unused memory

image

Distributed Pub/Sub (1M subscribers)

Demonstrates event delivery performace by publishing 1 event from 1 producer to 1,000,000 subscribers distributed across 10 nodes.

Key optimization: Instead of 1,000,000 network messages (one per subscriber), only 10 network messages are sent (one per consumer node). Each node locally distributes to its 100K subscribers.

Results:

  • Total subscribers: 1,000,000
  • Producer nodes: 1
  • Consumer nodes: 10
  • Time to deliver all: 342ms
  • Network messages sent: 10
  • Delivery rate: 2.9M msg/sec

Run with go run .

Hardware: Apple M4 Max

Serialization benchmarks: EDF vs Protobuf vs Gob

These benchmarks compare EDF, EDF (+cache), Protobuf, and Gob serialization performance across common data types.

  • EDF and Gob rely on runtime reflection, which dynamically inspects and serializes data structures at runtime
  • Protobuf uses code generation, producing static type-safe marshalling and unmarshalling logic.
Data TypeEDFEDF (+cache)ProtobufGobWinnerEDF Advantage
String Encode29.96ns, 53B, 0a23.45ns, 0B, 0a44.37ns, 32B, 1a76.42ns, 16B, 1aEDF+Cache47% faster than Protobuf, 69% faster than Gob
String Decode76.63ns, 72B, 4a76.62ns, 72B, 4a67.45ns, 96B, 2a429.5ns, 1000B, 19aProtobufEDF 14% slower, but 6x faster than Gob
Map Encode310.5ns, 325B, 10a224.7ns, 204B, 5a339.9ns, 112B, 5a234.0ns, 32B, 2aEDF+Cache34% faster than Protobuf, competitive with Gob
Map Decode557.4ns, 955B, 25a468.8ns, 846B, 22a353.3ns, 528B, 13a6733ns, 8256B, 185aProtobufEDF+Cache 33% slower, but 14x faster than Gob
Complex Struct Encode277.8ns, 307B, 6a269.8ns, 306B, 6a474.3ns, 224B, 9a357.1ns, 88B, 5aEDF+Cache43% faster than Protobuf, 24% faster than Gob
Complex Struct Decode740.1ns, 1364B, 41a700.8ns, 1368B, 41a597.2ns, 824B, 25a9335ns, 10872B, 255aProtobufEDF+Cache 17% slower, but 13x faster than Gob
Nested Struct Encode739.9ns, 732B, 17a796.2ns, 846B, 17a1557ns, 640B, 27a901.4ns, 256B, 15aEDF52% faster than Protobuf, 18% faster than Gob
Nested Struct Decode2137ns, 4594B, 107a2291ns, 5438B, 120a1684ns, 2544B, 71a12729ns, 14712B, 342aProtobufEDF 27% slower, but 6x faster than Gob

Format: time ns/op, memory B/op, allocations/op

Run with go test -bench=. -benchmem

Hardware: Apple M4 Max