Skip to content

chore(tests): Add benchmark tests for new and old netbox comparison

Егор Ивков requested to merge performance-test into master
  1. Adds benchmarks for netbox and network client comparison
  2. Refactors benchmarks (removes run_benchmarks.lua and unifies its logic with run_tests.lua)
  3. Removes BenchBulkInsert (see MR comments)

Results

Results on my machine:

test call_netbox            ... bench:      38,066 ns/iter (+/- 3,499)
test call_network_client    ... bench:      62,442 ns/iter (+/- 4,348)

test ping_client_tcp_stream ... bench:       8,652 ns/iter (+/- 3,486)
test ping_coio_stream       ... bench:       7,703 ns/iter (+/- 800)

test start_async_runtime    ... bench:         265 ns/iter (+/- 5)

We can make the following conclusions:

  1. netbox is 1.5 times faster than network::client
  2. async tcp_stream is nearly same as coio_stream
  3. runtime initialization can not be fully blamed for network::client being slower.

My working theory is that network::client is slower due to its sans-io architecture. E.g. where netbox was directly decoding/encoding the stream of input/output bytes, network::client has to buffer them first.

Edited by Егор Ивков

Merge request reports