-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (45 loc) · 1.46 KB
/
Makefile
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
define CRUD_BENCH_SCANS
[
{ "name": "count_all", "samples": 100, "projection": "COUNT" },
{ "name": "limit_id", "samples": 100, "projection": "ID", "limit": 100, "expect": 100 },
{ "name": "limit_all", "samples": 100, "projection": "FULL", "limit": 100, "expect": 100 },
{ "name": "limit_count", "samples": 100, "projection": "COUNT", "limit": 100, "expect": 100 },
{ "name": "limit_start_id", "samples": 100, "projection": "ID", "start": 5000, "limit": 100, "expect": 100 },
{ "name": "limit_start_all", "samples": 100, "projection": "FULL", "start": 5000, "limit": 100, "expect": 100 },
{ "name": "limit_start_count", "samples": 100, "projection": "COUNT", "start": 5000, "limit": 100, "expect": 100 }
]
endef
define CRUD_BENCH_VALUE
{
"text": "text:50",
"integer": "int",
"nested": {
"text": "text:1000",
"array": [
"string:50",
"string:50",
"string:50",
"string:50",
"string:50"
]
}
}
endef
database ?= surrealdb
.PHONY: default
default:
@echo "Choose a Makefile target:"
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print " - " $$1}}' | sort
.PHONY: build
build:
cargo build -r
export CRUD_BENCH_SCANS
export CRUD_BENCH_VALUE
.PHONY: dev
dev:
cargo run -- -d $(database) -s 100000 -c 128 -t 48 -k string26 -r
export CRUD_BENCH_SCANS
export CRUD_BENCH_VALUE
.PHONY: test
test:
target/release/crud-bench -d $(database) -s 1000000 -c 128 -t 48 -k string26 -r