This is the lab. Here, various algorithms are competing for the crown of highest encoding speed.
The benchmarks are performed using Go's integrated benchmarks and Hyperfine. The categories are: raw speed and data throughput.
Raw speed is calculated by running the benchmark 100 times and taking the average. This is done to account for variations in CPU Usage as this test is completed pretty quick.
|Algorithm||ns/Op Escaped||ns/Op Unescaped||ns/Op (exp. avg.)¹||nth fastest|
¹) assuming random distribution of bytes and that 4/256 bytes have to be escaped.
Data Throughput is calculated by running the encoding function on a set of randomly generated data which is written to a file. This operation is performed on a ramdisk to get raw numbers.
|Algorithm||Duration||Byte||Throughput||nth fastest||Speed relative to naive|
Variations in speed may be due to changes in the input dataset and fluctuations in computer activity.
To ensure maximum comparability, all fields are updated every time the benchmark is run. This way they should give an estimate even when run on a different system.