mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
295432b40e
example results when benchmarking 1-4 serialized ADD instructions ``` running 4 tests test add ... bench: 0.24 ns/iter (+/- 0.00) test add2 ... bench: 0.48 ns/iter (+/- 0.01) test add3 ... bench: 0.72 ns/iter (+/- 0.01) test add4 ... bench: 0.96 ns/iter (+/- 0.01) ```
15 lines
598 B
Makefile
15 lines
598 B
Makefile
# ignore-cross-compile because we run the compiled code
|
|
# needs-unwind because #[bench] and -Cpanic=abort requires -Zpanic-abort-tests
|
|
include ../tools.mk
|
|
|
|
NORMALIZE=sed 's%[0-9,\.]\{1,\} ns/iter (+/- [0-9,\.]\{1,\})%?? ns/iter (+/- ??)%' | sed 's%finished in [0-9\.]\{1,\}%finished in ??%'
|
|
|
|
all:
|
|
$(RUSTC) --test tests.rs
|
|
|
|
$(call RUN,tests) --test-threads=1 | $(NORMALIZE) > "$(TMPDIR)"/test.stdout
|
|
$(RUSTC_TEST_OP) "$(TMPDIR)"/test.stdout test.stdout
|
|
|
|
$(call RUN,tests) --test-threads=1 --bench | $(NORMALIZE) > "$(TMPDIR)"/bench.stdout
|
|
$(RUSTC_TEST_OP) "$(TMPDIR)"/bench.stdout bench.stdout
|