Commit d6f15744 authored by Kirill Smelkov's avatar Kirill Smelkov

X Benchmark wrt github.com/jsnell/ratas

See ratas@382321d2 for the
benchmark on Ratas side that tries to mimic what timeout benchmarks do.

See https://lab.nexedi.com/kirr/misc/-/blob/4f51fd6/bench/time-wheel/ratas-vs-timeout.pdf
for the result.

Not sure what I did differently on expire case, and maybe it is just Lua
vs C++, but the add and del benchmarks show that Ratas and Timeout are
of the same order in terms of performance.

I've also tried to activate LLRB-tree benchmark, and it showed that,
while expiring works faster compared to timer-wheel, adding and deleting
works siginficantly slower:

https://lab.nexedi.com/kirr/misc/-/blob/4f51fd6/bench/time-wheel/timeout-vs-llrb.pdf

For the reference original timeout vs minheap benchmark:

https://lab.nexedi.com/kirr/misc/-/blob/4f51fd6/bench/time-wheel/timeout-vs-minheap.pdf
parent 671d2046
......@@ -14,7 +14,7 @@ all:
top_srcdir = .
top_builddir = .
CFLAGS = -O2 -march=native -g -Wall -Wextra -Wno-unused-parameter -Wno-unused-function
CFLAGS = -O2 -march=native -g -Wall -Wextra -Wno-unused-parameter -Wno-unused-function $(shell pkg-config --cflags lua5.3)
SOFLAGS = $$(auto_soflags)
LIBS = $$(auto_libs)
......
......@@ -29,8 +29,8 @@ $(BENCH_ALGOS:%=$(top_builddir)/bench/%-expire.dat): $(top_srcdir)/bench/bench-e
$(top_builddir)/bench/bench.eps: \
$(BENCH_OPS:%=$(top_builddir)/bench/wheel-%.dat) \
$(BENCH_OPS:%=$(top_builddir)/bench/heap-%.dat)
# $(BENCH_OPS:%=$(top_builddir)/bench/llrb-%.dat)
$(BENCH_OPS:%=$(top_builddir)/bench/heap-%.dat) \
$(BENCH_OPS:%=$(top_builddir)/bench/llrb-%.dat)
$(top_builddir)/bench/bench.eps: $(top_srcdir)/bench/bench.plt
@$(SHRC); echo_cmd cd $(@D) && echo_cmd gnuplot $${top_srcdir}/bench/bench.plt > $(@F).tmp
......
......@@ -6,14 +6,20 @@ set ylabel "Time\n(microseconds)"
#set logscale x
set title "Time spent installing timeouts" font ",20"
plot 'heap-add.dat' using 1:($2*1000000) title "min-heap" with lines ls 1 lw 3 lc "red", \
'wheel-add.dat' using 1:($2*1000000) title "hierarchical wheel" with lines ls 1 lw 3 lc "forest-green"
plot 'heap-add.dat' using 1:($2*1000000) title "min-heap" with lines ls 1 lw 3 lc "red", \
'wheel-add.dat' using 1:($2*1000000) title "hierarchical wheel" with lines ls 1 lw 3 lc "forest-green", \
'ratas-add.dat' using 2:3 title "ratas" with lines ls 1 lw 3 lc "blue"
set title "Time spent deleting timeouts" font ",20"
plot 'heap-del.dat' using 1:($2*1000000) title "min-heap" with lines ls 1 lw 3 lc "red", \
'wheel-del.dat' using 1:($2*1000000) title "hierarchical wheel" with lines ls 1 lw 3 lc "forest-green"
'wheel-del.dat' using 1:($2*1000000) title "hierarchical wheel" with lines ls 1 lw 3 lc "forest-green", \
'ratas-del.dat' using 2:3 title "ratas" with lines ls 1 lw 3 lc "blue"
set title "Time spent expiring timeouts\n(by iteratively updating clock ~1000 times)" font ",20"
plot 'heap-expire.dat' using 1:($2*1000000) title "min-heap" with lines ls 1 lw 3 lc "red", \
'wheel-expire.dat' using 1:($2*1000000) title "hierarchical wheel" with lines ls 1 lw 3 lc "forest-green"
'wheel-expire.dat' using 1:($2*1000000) title "hierarchical wheel" with lines ls 1 lw 3 lc "forest-green", \
'ratas-exp.dat' using 2:3 title "ratas" with lines ls 1 lw 3 lc "blue"
# 'llrb-add.dat' using 1:($2*1000000) title "llrb-tree" with lines ls 1 lw 3 lc "blue"
# 'llrb-del.dat' using 1:($2*1000000) title "llrb-tree" with lines ls 1 lw 3 lc "blue"
# 'llrb-expire.dat' using 1:($2*1000000) title "llrb-tree" with lines ls 1 lw 3 lc "blue"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment