Revert "[mono][debugger] Fixing len as unsigned int and comparing < 0 (#20806)"
[mono-project.git] / acceptance-tests / microbench.mk
blob44015fb0df68439ceac8465a56ceedb07e6134a8
1 check-microbench: DebianShootoutMono.stamp
2 @$(MAKE) test-run-microbench
4 DebianShootoutMono.stamp:
5 @$(MAKE) validate-DebianShootoutMono RESET_VERSIONS=1
6 @$(MAKE) prepare-dlls
7 @touch $@
9 abs_top_srcdir = $(abspath $(top_srcdir))
10 TEST_EXE_PATH=$(abs_top_srcdir)/acceptance-tests/external/DebianShootoutMono/release/
11 NET_4_X_RUNTIME=MONO_PATH=$(TEST_EXE_PATH):$(abs_top_srcdir)/mcs/class/lib/net_4_x $(abs_top_srcdir)/runtime/mono-wrapper
12 FULL_AOT_RUNTIME=MONO_PATH=$(abs_top_srcdir)/mcs/class/lib/testing_aot_full $(abs_top_srcdir)/runtime/mono-wrapper
14 PERF_BINARY=$(if $(MONO_PERF_BINARY),$(MONO_PERF_BINARY),perf)
15 PERF_RUNTIME=$(abs_top_srcdir)/acceptance-tests/microbench-perf.sh
17 define BenchmarkDotNetTemplate
19 run-microbench-$(1):: DebianShootoutMono.stamp
20 MONO_BENCH_AOT_RUN="$(AOT_RUN_FLAGS)" \
21 MONO_BENCH_AOT_BUILD="$(AOT_BUILD_FLAGS)" \
22 MONO_BENCH_EXECUTABLE="$(abs_top_srcdir)/runtime/mono-wrapper" \
23 MONO_BENCH_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" \
24 MONO_BENCH_INPUT="$(2)" \
25 $(NET_4_X_RUNTIME) \
26 $(TEST_EXE_PATH)/DebianShootoutMono.exe $(1)
28 test-run-microbench:: run-microbench-$(1)
30 run-microbench-debug-$(1):: DebianShootoutMono.stamp
31 echo MONO_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" $(abs_top_srcdir)/runtime/mono-wrapper $(AOT_BUILD_FLAGS) $(TEST_EXE_PATH)/DebianShootoutMono.exe
32 MONO_BENCH_INPUT="$(2)" \
33 MONO_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" \
34 $(abs_top_srcdir)/runtime/mono-wrapper $(AOT_RUN_FLAGS) $(TEST_EXE_PATH)/DebianShootoutMono.exe Run $(1)
36 test-run-microbench-debug:: run-microbench-debug-$(1)
38 if HOST_LINUX
39 run-microbench-profiled-$(1):: microbench-results/$(1).perf.data
41 microbench-results/$(1).perf.data: DebianShootoutMono.stamp
42 mkdir -p microbench-results
43 MONO_PERF_BINARY="$(PERF_BINARY)" \
44 MONO_BENCH_EXECUTABLE="$(PERF_RUNTIME)" \
45 MONO_BENCH_AOT_RUN="$(AOT_RUN_FLAGS)"\
46 MONO_BENCH_AOT_BUILD="$(AOT_BUILD_FLAGS)"\
47 MONO_BENCH_PATH="$(abs_top_srcdir)/mcs/class/lib/$(TEST_PROFILE)" \
48 MONO_BENCH_INPUT="$(2)" \
49 $(NET_4_X_RUNTIME) \
50 $(TEST_EXE_PATH)/DebianShootoutMono.exe $(1) $(2)
51 mv perf.data microbench-results/$(1).perf.data
53 microbench-results/$(1).tmp.perf: microbench-results/$(1).perf.data
54 $(PERF_BINARY) script -i microbench-results/$(1).perf.data > microbench-results/$(1).tmp.perf
56 microbench-results/$(1).perf-flame.svg: microbench-results/$(1).tmp.perf
57 cat microbench-results/$(1).tmp.perf | ./external/DebianShootoutMono/FlameGraph/stackcollapse-perf.pl > microbench-results/$(1).perf-folded
58 ./external/DebianShootoutMono/FlameGraph/flamegraph.pl microbench-results/$(1).perf-folded > microbench-results/$(1).perf-flame.svg
59 rm microbench-results/$(1).tmp.perf
60 rm microbench-results/$(1).perf-folded
62 MONO_PERF_FLAGS=--show-cpu-utilization -n --hierarchy -T $(MONO_PERF_ADDITIONAL_FLAGS)
64 microbench-results/$(1).perf.report: microbench-results/$(1).perf.data
65 $(PERF_BINARY) report -i microbench-results/$(1).perf.data $(MONO_PERF_FLAGS) > microbench-results/$(1).perf.report
67 test-run-microbench-profiled:: run-microbench-profiled-$(1)
69 test-run-microbench-publish-collect:: microbench-results/$(1).perf.data microbench-results/$(1).perf.report microbench-results/$(1).perf-flame.svg
71 endif
73 endef
75 if HOST_LINUX
77 test-run-microbench-perf-check:
78 $(PERF_BINARY) record -a -o perf.data -- echo "testing"
79 rm perf.data
81 microbench-results/perf-data.zip:
82 zip microbench-results/perf-data.zip microbench-results/*.perf.data
83 rm microbench-results/*.perf.data
85 perf-report: microbench-results/perf-data.zip
87 perf-report-total: test-run-microbench-publish-collect
88 @$(MAKE) perf-report
90 endif
92 .PHONY: prepare-dlls
94 if FULL_AOT_TESTS
95 prepare-dlls:
96 $(FULL_AOT_RUNTIME) $(AOT_BUILD_FLAGS) $(TEST_EXE_PATH)/*.{dll,exe}
98 else
100 prepare-dlls:
102 endif
104 FIXTURE_DIR=$(abs_top_srcdir)/acceptance-tests/external/DebianShootoutMono/fixtures
106 $(eval $(call BenchmarkDotNetTemplate,Mandelbrot,))
107 $(eval $(call BenchmarkDotNetTemplate,RegexRedux,$(FIXTURE_DIR)/regexredux-input.txt))
108 $(eval $(call BenchmarkDotNetTemplate,KNucleotide,$(FIXTURE_DIR)/knucleotide-input.txt))
110 $(eval $(call BenchmarkDotNetTemplate,BinaryTrees,))
111 $(eval $(call BenchmarkDotNetTemplate,NBodyTest,))
112 $(eval $(call BenchmarkDotNetTemplate,SpectralNorm,))
113 $(eval $(call BenchmarkDotNetTemplate,Fannkuchredux,))
114 $(eval $(call BenchmarkDotNetTemplate,Fasta,))
116 $(eval $(call BenchmarkDotNetTemplate,RevComp,$(FIXTURE_DIR)/revcomp-input.txt))
118 #$(eval $(call BenchmarkDotNetTemplate,GistBenchmark,$(MONO_BENCH_GIST_URL))) broken in BDN, bug filed