summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Gordon <github@chqrlie.org>2024-02-18 17:52:35 +0100
committerCharlie Gordon <github@chqrlie.org>2024-02-19 01:13:07 +0100
commit97ae6f39e641dc5e6f8275833bccd2cbed01545c (patch)
treebcfd2df1a0547d11d83015378ba403e37cb299b4
parentc24a865a29912c9c90decc3a30639027eadb9606 (diff)
downloadquickjs-97ae6f39e641dc5e6f8275833bccd2cbed01545c.tar.gz
quickjs-97ae6f39e641dc5e6f8275833bccd2cbed01545c.zip
Add benchmarks target
- assuming quickjs-benchmarks is cloned in the parent directory, - compile quickjs-benchmarks targets and run the benchmarks
-rw-r--r--.gitignore2
-rw-r--r--Makefile15
2 files changed, 17 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 2e92430..5988f92 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@ test262o
test262o_*.txt
unicode
unicode_gen
+run_octane
+run_sunspider_like
diff --git a/Makefile b/Makefile
index 44aaa0c..f16a69a 100644
--- a/Makefile
+++ b/Makefile
@@ -351,6 +351,7 @@ clean:
rm -f examples/*.so tests/*.so
rm -rf $(OBJDIR)/ *.dSYM/ qjs-debug
rm -rf run-test262-debug run-test262-32
+ rm -f run_octane run_sunspider_like
install: all
mkdir -p "$(DESTDIR)$(PREFIX)/bin"
@@ -531,4 +532,18 @@ bench-v8: qjs
tests/bjson.so: $(OBJDIR)/tests/bjson.pic.o
$(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
+BENCHMARKDIR=../quickjs-benchmarks
+
+run_sunspider_like: $(BENCHMARKDIR)/run_sunspider_like.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -DNO_INCLUDE_DIR -I. -o $@ $< libquickjs$(LTOEXT).a $(LIBS)
+
+run_octane: $(BENCHMARKDIR)/run_octane.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -DNO_INCLUDE_DIR -I. -o $@ $< libquickjs$(LTOEXT).a $(LIBS)
+
+benchmarks: run_sunspider_like run_octane
+ ./run_sunspider_like $(BENCHMARKDIR)/kraken-1.0/
+ ./run_sunspider_like $(BENCHMARKDIR)/kraken-1.1/
+ ./run_sunspider_like $(BENCHMARKDIR)/sunspider-1.0/
+ ./run_octane $(BENCHMARKDIR)/
+
-include $(wildcard $(OBJDIR)/*.d)