Skip to content

Commit 5ca3a69

Browse files
committed
emit js and html benchmarks
1 parent 37bbce3 commit 5ca3a69

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ EMCC=$(EMSCRIPTEN)/emcc -s RESERVED_FUNCTION_POINTERS=2 -O2 --closure 1 -s ASM_J
44
# -s INLINING_LIMIT=0
55
CFLAGS=-DSQLITE_DISABLE_LFS -DLONGDOUBLE_TYPE=double -DSQLITE_INT64_TYPE="long long int" -DSQLITE_THREADSAFE=0
66

7-
all: js/sql.js test/benchmark.html test/benchmark
7+
all: js/sql.js test/benchmark.js test/benchmark
88

99
js/sql.js: c/sqlite3.c
1010
$(EMCC) $(CFLAGS) c/sqlite3.c c/main.c --pre-js js/pre.js --post-js js/post.js -o js/sql.js -s EXPORTED_FUNCTIONS="['_sqlite3_open', '_sqlite3_close', '_sqlite3_exec']"
1111

12-
test/benchmark.html: c/sqlite3.c c/benchmark.c
13-
$(EMCC) $(CFLAGS) c/sqlite3.c c/benchmark.c -o test/benchmark.html
12+
test/benchmark.js: c/sqlite3.c c/benchmark.c
13+
$(EMCC) $(CFLAGS) c/sqlite3.c c/benchmark.c -o test/benchmark.js
1414

1515
test/benchmark: c/benchmark.c
1616
gcc $(CFLAGS) -pthread -O2 c/sqlite3.c c/benchmark.c -o test/benchmark -ldl
1717

1818
clean:
19-
rm js/sql.js test/benchmark.html test/benchmark
19+
rm js/sql.js test/benchmark.js test/benchmark
2020

test/benchmark.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
<script>
3+
var startTime = Date.now();
4+
</script>
5+
<script src="benchmark.js"></script>
6+
<script>
7+
console.log('total time: ' + (Date.now() - startTime));
8+
</script>
9+

0 commit comments

Comments
 (0)