commit 614e7fd209181702fd8d28f1c37ad836ba6c9ee8
parent 2e1baf4b4debc4e2ae860c23a21a159237ab0186
Author: Charlie Gordon <github@chqrlie.org>
Date: Sun, 18 Feb 2024 17:52:35 +0100
Add benchmarks target
- assuming quickjs-benchmarks is cloned in the parent directory,
- compile quickjs-benchmarks targets and run the benchmarks
Diffstat:
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/quickjs/.gitignore b/quickjs/.gitignore
@@ -20,3 +20,5 @@ test262o
test262o_*.txt
unicode
unicode_gen
+run_octane
+run_sunspider_like
diff --git a/quickjs/Makefile b/quickjs/Makefile
@@ -352,6 +352,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"
@@ -532,4 +533,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)