Skip to content

Draft: common: explore options to reduce regex usage in Reports

Abhishek Lekshmanan requested to merge EOS-5391 into master

This changeset does a few microbenchmarks to determine some faster options for validating the hosts in reports.

  • use stringview startsWith: This is similar to the string variant, just might be faster in some cases, esp when encountering compile time strings.
  • Add microbenchmarks on the existing routines

Currently the results of the various microbenchmarks are:

./test/microbenchmarks/eos-microbenchmarks --benchmark_filter=Re
2022-09-19T17:16:37+02:00
Running ./test/microbenchmarks/eos-microbenchmarks
Run on (10 X 2100 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x10)
  L1 Instruction 32 KiB (x10)
  L2 Unified 4096 KiB (x10)
  L3 Unified 16384 KiB (x10)
Load Average: 0.00, 0.08, 1.03
---------------------------------------------------------------------------------
Benchmark                       Time             CPU   Iterations UserCounters...
---------------------------------------------------------------------------------
BM_ReMatch                   4806 ns         4806 ns       144238 frequency=208.074k/s
BM_ReMatchPreInit            1028 ns         1028 ns       669686 frequency=972.336k/s
BM_NoReStartsWith            12.3 ns         12.3 ns     57022289 frequency=81.4149M/s
BM_NoReStartsWithsview       4.12 ns         4.12 ns    169752993 frequency=242.483M/s
BM_Reipv4                  161470 ns       161469 ns         4333 frequency=6.19313k/s
BM_Reipv4PreInit              729 ns          729 ns       959454 frequency=1.37219M/s
BM_NoReipv4                  73.9 ns         73.7 ns      9578669 frequency=13.5665M/s
BM_NoReipv6                  77.2 ns         77.2 ns      9054422 frequency=12.9475M/s

Closes EOS-5391

Edited by Abhishek Lekshmanan

Merge request reports