mirror of
https://github.com/remko/waforth
synced 2024-11-16 07:47:30 +01:00
More benchmarks
This commit is contained in:
parent
f2c4871809
commit
704e3d6644
5 changed files with 32 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -13,3 +13,5 @@ dist/
|
|||
*.bin
|
||||
*.assembled.wat
|
||||
*.o
|
||||
/run_sieve
|
||||
/run_sieve.c
|
||||
|
|
22
Makefile
22
Makefile
|
@ -43,5 +43,25 @@ waforthc:
|
|||
|
||||
clean:
|
||||
-rm -rf $(WASM_FILES) scripts/word.wasm scripts/word.wasm.hex src/waforth.wat.tmp \
|
||||
public/waforth
|
||||
public/waforth run_sieve.*
|
||||
|
||||
|
||||
################################################################################
|
||||
# Sieve benchmark
|
||||
################################################################################
|
||||
|
||||
run_sieve.c: src/web/benchmarks/sieve/sieve.c
|
||||
(echo "#include <stdio.h>" && cat $< && echo "int main() { printf(\"%d\\\n\", sieve(90000000)); return 0; }") > $@
|
||||
|
||||
run_sieve: run_sieve.c
|
||||
$(CC) -O2 -o $@ $<
|
||||
|
||||
run-sieve: run_sieve
|
||||
time ./run_sieve
|
||||
|
||||
run-sieve-gforth:
|
||||
time gforth -m 100000 src/examples/sieve.f -e "90000000 sieve bye"
|
||||
|
||||
run-sieve-gforth-fast:
|
||||
time gforth-fast -m 100000 src/examples/sieve.f -e "90000000 sieve bye"
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ run_sieve.f: ../examples/sieve.f
|
|||
|
||||
.PHONY: run-sieve
|
||||
run-sieve: run_sieve.f
|
||||
./waforth $<
|
||||
time ./waforth $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
|
1
src/standalone/wabt/.gitignore
vendored
1
src/standalone/wabt/.gitignore
vendored
|
@ -3,3 +3,4 @@
|
|||
/wasm-micro-runtime
|
||||
/wasmtime-*
|
||||
/*.tgz
|
||||
/run_sieve.f
|
||||
|
|
|
@ -64,6 +64,13 @@ waforth_core.h: waforth_core.wasm
|
|||
|
||||
.PHONY: package
|
||||
|
||||
run_sieve.f: ../../examples/sieve.f
|
||||
(cat $< && echo "90000000 sieve") > $@
|
||||
|
||||
.PHONY: run-sieve
|
||||
run-sieve: run_sieve.f
|
||||
time ./waforth $<
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
-rm -f test.out
|
||||
|
|
Loading…
Reference in a new issue