forked from asg017/sqlite-loadable-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (71 loc) · 3 KB
/
Copy pathMakefile
File metadata and controls
94 lines (71 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
TARGET_SERIES_C=target/series_c.dylib
TARGET_SERIES_GO=target/series_go.dylib
TARGET_SERIES_RS=target/series_rs.dylib
TARGET_SCALAR_C=target/scalar_c.dylib
TARGET_SCALAR_GO=target/scalar_go.dylib
TARGET_SCALAR_RS=target/scalar_rs.dylib
# SERIES
$(TARGET_SERIES_C): series/series.c
gcc -O3 -I ../sqlite3ext-sys/sqlite3/ $< -fPIC -shared -o $@
$(TARGET_SERIES_GO): series/series.go
go build -buildmode=c-shared -o $@ $<
$(TARGET_SERIES_RS): ../examples/series.rs
cargo build --manifest-path=../Cargo.toml --example series --release
cp ../target/release/examples/libseries.dylib $@
# SCALAR
$(TARGET_SCALAR_C): scalar/scalar.c
gcc -O3 -I ../sqlite3ext-sys/sqlite3/ $< -fPIC -shared -o $@
$(TARGET_SCALAR_GO): scalar/scalar.go
go build -buildmode=c-shared -o $@ $<
$(TARGET_SCALAR_RS): ../examples/scalar.rs
cargo build --manifest-path=../Cargo.toml --example scalar --release
cp ../target/release/examples/libscalar.dylib $@
series: $(TARGET_SERIES_GO) $(TARGET_SERIES_C) $(TARGET_SERIES_RS)
scalar: $(TARGET_SCALAR_GO) $(TARGET_SCALAR_C) $(TARGET_SCALAR_RS)
all: series scalar
SHELL=/bin/bash
scalar-yo.png: ./scalar/results-yo.json Makefile
observable-prerender @asg017/hyperfine-benchmark-viz1 chart \
--redefine=width:900 \
--width 900 \
--redefine-file=data:json:$< \
--redefine-file=highlight:json:<(echo '["./yo_rs.sh 1e6"]') \
'--redefine=compareTo:./yo_rs.sh 1e6' \
'--redefine=title:Run yo(), a static deterministic function, 1 million times' \
'--redefine=footer:ran on a 2019 Macbook, i5 processing and 8GB RAM' \
-o $@
scalar-add.png: ./scalar/results-add.json Makefile
observable-prerender @asg017/hyperfine-benchmark-viz1 chart \
--redefine=width:900 \
--width 900 \
--redefine-file=data:json:$< \
--redefine-file=highlight:json:<(echo '["./add_rs.sh 1e6"]') \
'--redefine=compareTo:./add_rs.sh 1e6' \
'--redefine=title:Run add(a, b) 1 million times on different inputs' \
'--redefine=footer:ran on a 2019 Macbook, i5 processing and 8GB RAM' \
-o $@
scalar-surround.png: ./scalar/results-surround.json Makefile
observable-prerender @asg017/hyperfine-benchmark-viz1 chart \
--redefine=width:900 \
--width 900 \
--redefine-file=data:json:$< \
--redefine-file=highlight:json:<(echo '["./surround_rs.sh"]') \
'--redefine=compareTo:./surround_rs.sh' \
'--redefine=title:run surround(x) on every word in /usr/share/dict/words ' \
'--redefine=footer:ran on a 2019 Macbook, i5 processing and 8GB RAM' \
-o $@
series.png: ./series/results.json Makefile
observable-prerender @asg017/hyperfine-benchmark-viz1 chart \
--redefine=width:900 \
--width 900 \
--redefine-file=data:json:$< \
--redefine-file=highlight:json:<(echo '["./series_rs.sh 1e6"]') \
'--redefine=compareTo:./series_rs.sh 1e6' \
'--redefine=title:Run generate_series() and return 1 million rows' \
'--redefine=footer:ran on a 2019 Macbook, i5 processing and 8GB RAM' \
-o $@
scalar_pngs: scalar-add.png scalar-surround.png scalar-yo.png
clean:
rm target/*
rm *.png
.PHONY: all clean series scalar