-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (41 loc) · 1.24 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
52
53
54
55
56
57
58
59
all:
test: generate
go test -cover ./...
show_cover: generate
go test -cover ./... -coverprofile=cover.out
go tool cover -html=cover.out -o cover.html
open cover.html
clean:
-rm *.dat *.dict *.trie
generate:
$(MAKE) -C doublearray $@
URL := https://dumps.wikimedia.org/jawiki/latest/jawiki-latest-all-titles.gz
jawiki-latest-all-titles.gz:
# donwloading wikipedia article titles.
# see their license
# https://dumps.wikimedia.org/legal.html
# CC BY-SA 3.0
# https://creativecommons.org/licenses/by-sa/3.0/
curl -o $@ $(URL)
bench.dat: jawiki-latest-all-titles.gz
gunzip -c $< | cut -f 2 | sort | uniq > $@
tiny_data:
cat LICENSE| tr ' ' '\n' | grep -v "^$$" | sort -u | uniq > head.dat
SOURCE := uuid.dat
head.dat: $(SOURCE) Makefile
tail -n 100000 $< > $@
uuid.dat:
go run cmd/gen/main.go > $@
%.trie: head.dat
go run cmd/dump/main.go -o $@ -in $< -kind $* -v
bench: generate codec-data
go test -benchmem -bench BenchmarkCodec
all-bench: generate codec-data data
go test -benchmem -bench .
data: byte.trie rune.trie darts.trie dict.trie
codec-data: bytes-m.trie bytes-a.trie bytes-i.trie \
u16s-m.trie u16s-a.trie u16s-i.trie \
runes-m.trie runes-i.trie \
darts.trie
test_overhead: generate byte.trie
go test -bench Overhead