Skip to content

Commit 97ae6f3

Browse files
committed
Add benchmarks target
- assuming quickjs-benchmarks is cloned in the parent directory, - compile quickjs-benchmarks targets and run the benchmarks
1 parent c24a865 commit 97ae6f3

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ test262o
2020
test262o_*.txt
2121
unicode
2222
unicode_gen
23+
run_octane
24+
run_sunspider_like

Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ clean:
351351
rm -f examples/*.so tests/*.so
352352
rm -rf $(OBJDIR)/ *.dSYM/ qjs-debug
353353
rm -rf run-test262-debug run-test262-32
354+
rm -f run_octane run_sunspider_like
354355

355356
install: all
356357
mkdir -p "$(DESTDIR)$(PREFIX)/bin"
@@ -531,4 +532,18 @@ bench-v8: qjs
531532
tests/bjson.so: $(OBJDIR)/tests/bjson.pic.o
532533
$(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
533534

535+
BENCHMARKDIR=../quickjs-benchmarks
536+
537+
run_sunspider_like: $(BENCHMARKDIR)/run_sunspider_like.c
538+
$(CC) $(CFLAGS) $(LDFLAGS) -DNO_INCLUDE_DIR -I. -o $@ $< libquickjs$(LTOEXT).a $(LIBS)
539+
540+
run_octane: $(BENCHMARKDIR)/run_octane.c
541+
$(CC) $(CFLAGS) $(LDFLAGS) -DNO_INCLUDE_DIR -I. -o $@ $< libquickjs$(LTOEXT).a $(LIBS)
542+
543+
benchmarks: run_sunspider_like run_octane
544+
./run_sunspider_like $(BENCHMARKDIR)/kraken-1.0/
545+
./run_sunspider_like $(BENCHMARKDIR)/kraken-1.1/
546+
./run_sunspider_like $(BENCHMARKDIR)/sunspider-1.0/
547+
./run_octane $(BENCHMARKDIR)/
548+
534549
-include $(wildcard $(OBJDIR)/*.d)

0 commit comments

Comments
 (0)