HaloLog and the Problem With a 23.9 ns Benchmark

https://hackernoon.imgix.net/images/4Pd5EwqsvDbKNP5rkqpvRfPXx1h1-jy83cdy.png

Part 1 of Engineering HaloLog: making high-performance telemetry claims reproducible and falsifiable.

23.9 ns/op is a dangerous number.

It is precise enough to be repeated and incomplete enough to mislead. Without the work unit, output contract, clock semantics, sink, concurrency model, hardware, toolchain, and competing configurations, it is not yet an engineering result. It is only a number with good typography.

I built HaloLog, a structured logger for Go, around a zero-allocation hot path. On the original benchmark host, its bare-message path encoded and dispatched a complete JSON record in 23.9 ns. That reciprocal is roughly 42 million records per second on one goroutine.

The second sentence needs more care than the first. It is arithmetic derived from a microbenchmark, not a sustained ingestion test. The benchmark writes to io.Discard; it does not measure disk, network, batching, backpressure, or a production log collector. And the 23.9 ns value itself is...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more