Skip to content

Commit

Permalink
Reorganize each test into its own folder.
Browse files Browse the repository at this point in the history
Interaction with dynamic symbols is going to be different for each one.
  • Loading branch information
robertdfrench committed Aug 31, 2024
1 parent f3e5a08 commit 2db0628
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 16 deletions.
35 changes: 19 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ rigorous_speed_demo: clean $(RIGOROUS_SPEED_STATS) #: Really, how slow is it?
@printf "ifunc\t"; cat speed_demo_ifunc.stats.txt
@echo ""

RIDICULOUS_STATS=speed_demo_fixed.stats.txt \
speed_demo_ifunc.stats.txt \
speed_demo_pointer.stats.txt \
speed_demo_struct.stats.txt \
speed_demo_always.stats.txt \
speed_demo_upfront.stats.txt
RIDICULOUS_STATS=fixed.stats.txt \
ifunc.stats.txt \
pointer.stats.txt \
struct.stats.txt \
always.stats.txt \
upfront.stats.txt
ridiculous_speed_demo: clean $(RIDICULOUS_STATS) #: Compare other techniques
$(call banner, Final Results)
@echo "TEST LOW HIGH AVG"
@printf "fixed\t"; cat speed_demo_fixed.stats.txt
@printf "pointer\t"; cat speed_demo_pointer.stats.txt
@printf "struct\t"; cat speed_demo_struct.stats.txt
@printf "ifunc\t"; cat speed_demo_ifunc.stats.txt
@printf "upfront\t"; cat speed_demo_upfront.stats.txt
@printf "always\t"; cat speed_demo_always.stats.txt
@printf "fixed\t"; cat fixed.stats.txt
@printf "pointer\t"; cat pointer.stats.txt
@printf "struct\t"; cat struct.stats.txt
@printf "ifunc\t"; cat ifunc.stats.txt
@printf "upfront\t"; cat upfront.stats.txt
@printf "always\t"; cat always.stats.txt
@echo ""

%.stats.txt: %.low.txt %.high.txt %.avg.txt
Expand All @@ -74,9 +74,9 @@ ridiculous_speed_demo: clean $(RIDICULOUS_STATS) #: Compare other techniques
%.avg.txt: %.timings.txt
awk '{ sum += $$1 }; END { print sum/NR }' $< > $@

%.timings.txt: %.exe
%.timings.txt: code/speed_demo/%/main.exe
$(call banner, Sampling performance of $<)
(for i in `seq 1 10`; do \
(for i in `seq 1 2`; do \
time -f "%U" ./$<; \
done) 2>&1 | tee $@

Expand All @@ -95,8 +95,11 @@ vector_add.exe: code/vector_add.c
plt_example.exe: code/plt_example.c
gcc -fPIC -no-pie -o $@ $<

%.exe: code/%.c
gcc -o $@ $<
speed_demo_%.exe: code/speed_demo/%/main.exe
cp $< $@

code/speed_demo/%/main.exe:
make -C code/speed_demo/$* main.exe

%.plt: %.exe
objdump -d -r $< \
Expand Down
2 changes: 2 additions & 0 deletions code/speed_demo/always/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main.exe: main.c
gcc $< -o $@
File renamed without changes.
2 changes: 2 additions & 0 deletions code/speed_demo/fixed/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main.exe: main.c
gcc $< -o $@
File renamed without changes.
2 changes: 2 additions & 0 deletions code/speed_demo/ifunc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main.exe: main.c
gcc $< -o $@
File renamed without changes.
2 changes: 2 additions & 0 deletions code/speed_demo/pointer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main.exe: main.c
gcc $< -o $@
File renamed without changes.
2 changes: 2 additions & 0 deletions code/speed_demo/struct/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main.exe: main.c
gcc $< -o $@
File renamed without changes.
2 changes: 2 additions & 0 deletions code/speed_demo/upfront/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main.exe: main.c
gcc $< -o $@
File renamed without changes.

0 comments on commit 2db0628

Please sign in to comment.