1
1
.PHONY : help
2
2
3
3
help :
4
- @grep -E ' ^[a -zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
4
+ @grep -E ' ^[0-9a -zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
5
5
6
6
.DEFAULT_GOAL := help
7
7
@@ -20,7 +20,7 @@ gofmt: ## Run gofmt.
20
20
21
21
.PHONY : goimports
22
22
goimports : # # Run goimports.
23
- goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*" )
23
+ goimports -d $(find . -type f -regexp '*.go' -not -path "./vendor/*" )
24
24
25
25
.PHONY : vet
26
26
vet : # # Run vet.
@@ -32,4 +32,89 @@ staticcheck: ## Run staticcheck.
32
32
33
33
.PHONY : test-benchmark
34
34
test-benchmark : # # Run benchmark tests.
35
- go test -bench=. -benchmem
35
+ go test -bench=. -benchmem
36
+
37
+ .PHONY : test-benchmark-static
38
+ test-benchmark-static : # # Run benchmark tests only static.
39
+ go test -bench=^BenchmarkStatic.* -benchmem
40
+
41
+ .PHONY : test-benchmark-pathparam
42
+ test-benchmark-pathparam : # # Run benchmark tests only pathparam.
43
+ go test -bench=^BenchmarkPathParam.* -benchmem
44
+
45
+ .PHONY : test-benchmark-by-regexp
46
+ test-benchmark-by-regexp : # # Run benchmark tests using regexp. ex. make test-benchmark-by-regexp EXP=Goblin, make test-benchmark-by-regexp EXP=StaticRoutes1
47
+ go test -bench=.* ${EXP} .* -benchmem
48
+
49
+ .PHONY : report-static-routes-root
50
+ report-static-routes-root : # # Run benchmark tests for reporing of StaticRoutesRoot.
51
+ make test-benchmark-by-regexp EXP=StaticRoutesRoot | grep --line-buffered ^Bench > reports/tmp.csv
52
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/static-routes-root/time.csv
53
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/static-routes-root/nsop.csv
54
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/static-routes-root/bop.csv
55
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/static-routes-root/allocs.csv
56
+ rm -rf reports/tmp.csv
57
+
58
+ .PHONY : report-static-routes-1
59
+ report-static-routes-1 : # # Run benchmark tests for reporing of StaticRoutes1.
60
+ make test-benchmark-by-regexp EXP=StaticRoutes1[^0] | grep --line-buffered ^Bench > reports/tmp.csv
61
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/static-routes-1/time.csv
62
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/static-routes-1/nsop.csv
63
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/static-routes-1/bop.csv
64
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/static-routes-1/allocs.csv
65
+ rm -rf reports/tmp.csv
66
+
67
+ .PHONY : report-static-routes-5
68
+ report-static-routes-5 : # # Run benchmark tests for reporing of StaticRoutes5.
69
+ make test-benchmark-by-regexp EXP=StaticRoutes5 | grep --line-buffered ^Bench > reports/tmp.csv
70
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/static-routes-5/time.csv
71
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/static-routes-5/nsop.csv
72
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/static-routes-5/bop.csv
73
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/static-routes-5/allocs.csv
74
+ rm -rf reports/tmp.csv
75
+
76
+ .PHONY : report-static-routes-10
77
+ report-static-routes-10 : # # Run benchmark tests for reporing of StaticRoutes10.
78
+ make test-benchmark-by-regexp EXP=StaticRoutes10 | grep --line-buffered ^Bench > reports/tmp.csv
79
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/static-routes-10/time.csv
80
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/static-routes-10/nsop.csv
81
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/static-routes-10/bop.csv
82
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/static-routes-10/allocs.csv
83
+ rm -rf reports/tmp.csv
84
+
85
+ .PHONY : report-pathparam-routes-1
86
+ report-pathparam-routes-1 : # # Run benchmark tests for reporing of PathParamRoutes1.
87
+ make test-benchmark-by-regexp EXP=PathParamRoutes1[^0] | grep --line-buffered ^Bench > reports/tmp.csv
88
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/pathparam-routes-1/time.csv
89
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/pathparam-routes-1/nsop.csv
90
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/pathparam-routes-1/bop.csv
91
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/pathparam-routes-1/allocs.csv
92
+ rm -rf reports/tmp.csv
93
+
94
+ .PHONY : report-pathparam-routes-5
95
+ report-pathparam-routes-5 : # # Run benchmark tests for reporing of PathParamRoutes5.
96
+ make test-benchmark-by-regexp EXP=PathParamRoutes5 | grep --line-buffered ^Bench > reports/tmp.csv
97
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/pathparam-routes-5/time.csv
98
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/pathparam-routes-5/nsop.csv
99
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/pathparam-routes-5/bop.csv
100
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/pathparam-routes-5/allocs.csv
101
+ rm -rf reports/tmp.csv
102
+
103
+ .PHONY : report-pathparam-routes-10
104
+ report-pathparam-routes-10 : # # Run benchmark tests for reporing of PathParamRoutes10.
105
+ make test-benchmark-by-regexp EXP=PathParamRoutes10 | grep --line-buffered ^Bench > reports/tmp.csv
106
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$2}' > reports/pathparam-routes-10/time.csv
107
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$3}' > reports/pathparam-routes-10/nsop.csv
108
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$5}' > reports/pathparam-routes-10/bop.csv
109
+ cat reports/tmp.csv | awk -v OFS=, ' {print $$1,$$7}' > reports/pathparam-routes-10/allocs.csv
110
+ rm -rf reports/tmp.csv
111
+
112
+ .PHONY : report
113
+ report : # # Run benchmark tests for reporing.
114
+ make report-static-routes-root
115
+ make report-static-routes-1
116
+ make report-static-routes-5
117
+ make report-static-routes-10
118
+ make report-pathparam-routes-1
119
+ make report-pathparam-routes-5
120
+ make report-pathparam-routes-10
0 commit comments