Commit b79ec2ee authored by William Ahern's avatar William Ahern

add gnuplot code

parent 8793dd42
CPPFLAGS = -DTIMEOUT_DEBUG
CFLAGS = -O2 -march=native -g -Wall -Wextra -Wno-unused-parameter
LUA = lua
all: bench.so bench-wheel.so bench-heap.so bench-llrb.so all: bench.so bench-wheel.so bench-heap.so bench-llrb.so
WHEEL_BIT = 6 WHEEL_BIT = 6
WHEEL_NUM = 4 WHEEL_NUM = 4
CPPFLAGS = -DTIMEOUT_DEBUG
CFLAGS = -O2 -march=native -g -Wall -Wextra -Wno-unused-parameter
timeout: CPPFLAGS+=-DWHEEL_BIT=$(WHEEL_BIT) -DWHEEL_NUM=$(WHEEL_NUM) timeout: CPPFLAGS+=-DWHEEL_BIT=$(WHEEL_BIT) -DWHEEL_NUM=$(WHEEL_NUM)
timeout8: CPPFLAGS+=-DWHEEL_BIT=3 -DWHEEL_NUM=$(WHEEL_NUM) timeout8: CPPFLAGS+=-DWHEEL_BIT=3 -DWHEEL_NUM=$(WHEEL_NUM)
...@@ -73,11 +74,25 @@ bench-wheel.so: timeout.c ...@@ -73,11 +74,25 @@ bench-wheel.so: timeout.c
bench-%.so: bench-%.c timeout.h bench-%.so: bench-%.c timeout.h
$(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) -Wno-unused-function $(SOFLAGS) $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) -Wno-unused-function $(SOFLAGS)
%-add.dat: bench-%.so bench-add.lua bench-aux.lua bench.so
$(LUA) bench-add.lua $< > $@.tmp
mv $@.tmp $@
%-del.dat: bench-%.so bench-del.lua bench-aux.lua bench.so
$(LUA) bench-del.lua $< > $@.tmp
mv $@.tmp $@
%-expire.dat: bench-%.so bench-expire.lua bench-aux.lua bench.so
$(LUA) bench-expire.lua $< > $@.tmp
mv $@.tmp $@
bench.eps: bench.plt $(foreach OP, add del expire, wheel-$(OP).dat heap-$(OP).dat)
gnuplot bench.plt
.PHONY: clean clean~ .PHONY: clean clean~
clean: clean:
$(RM) -r timeout timeout8 timeout16 timeout32 timeout64 *.dSYM *.so *.o $(RM) -r timeout timeout8 timeout16 timeout32 timeout64 *.dSYM *.so *.o *.dat
clean~: clean clean~: clean
$(RM) *~ $(RM) *~
set terminal postscript color
set output "bench.eps"
set key top left
set xlabel "Number of timeouts"
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"
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"
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"
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