diff --git a/.gitignore b/.gitignore index 1facee0..3575102 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .linguist -benchmark/output +benchmarks/output diff --git a/Makefile b/Makefile index 7fbd6ac..238674f 100644 --- a/Makefile +++ b/Makefile @@ -33,14 +33,14 @@ code-generate: $(LINGUIST_PATH) go run internal/code-generator/main.go benchmarks: $(LINGUIST_PATH) - go test -run=NONE -bench=. && benchmark/linguist-total.sh + go test -run=NONE -bench=. && benchmarks/linguist-total.sh benchmarks-samples: $(LINGUIST_PATH) - go test -run=NONE -bench=. -benchtime=5us && benchmark/linguist-samples.rb + go test -run=NONE -bench=. -benchtime=5us && benchmarks/linguist-samples.rb benchmarks-slow: $(LINGUST_PATH) - mkdir -p benchmark/output && go test -run=NONE -bench=. -slow -benchtime=100ms -timeout=100h >benchmark/output/enry_samples.bench && \ - benchmark/linguist-samples.rb 5 >benchmark/output/linguist_samples.bench + mkdir -p benchmarks/output && go test -run=NONE -bench=. -slow -benchtime=100ms -timeout=100h >benchmarks/output/enry_samples.bench && \ + benchmarks/linguist-samples.rb 5 >benchmarks/output/linguist_samples.bench clean: rm -rf $(LINGUIST_PATH) diff --git a/benchmark/parse.sh b/benchmark/parse.sh deleted file mode 100755 index c89b5a3..0000000 --- a/benchmark/parse.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cd benchmark/output && go run ../parser/main.go -outdir ../csv && \ -cd ../csv && go run ../parser/main.go -distribution - diff --git a/benchmark/run-benchmark.sh b/benchmark/run-benchmark.sh deleted file mode 100755 index 36af852..0000000 --- a/benchmark/run-benchmark.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -mkdir -p benchmark/output && go test -run NONE -bench=. -benchtime=120s -timeout=100h >benchmark/output/enry_total.bench && \ -benchmark/linguist-total.rb 5 >benchmark/output/linguist_total.bench diff --git a/benchmark/run.sh b/benchmark/run.sh deleted file mode 100755 index c46ceae..0000000 --- a/benchmark/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -benchmark/run-benchmark.sh && make benchmarks-slow && \ -benchmark/parse.sh && benchmark/plot-histogram.gp diff --git a/benchmark/csv/enry-distribution.csv b/benchmarks/csv/enry-distribution.csv similarity index 100% rename from benchmark/csv/enry-distribution.csv rename to benchmarks/csv/enry-distribution.csv diff --git a/benchmark/csv/enry-samples.csv b/benchmarks/csv/enry-samples.csv similarity index 100% rename from benchmark/csv/enry-samples.csv rename to benchmarks/csv/enry-samples.csv diff --git a/benchmark/csv/enry-total.csv b/benchmarks/csv/enry-total.csv similarity index 100% rename from benchmark/csv/enry-total.csv rename to benchmarks/csv/enry-total.csv diff --git a/benchmark/csv/linguist-distribution.csv b/benchmarks/csv/linguist-distribution.csv similarity index 100% rename from benchmark/csv/linguist-distribution.csv rename to benchmarks/csv/linguist-distribution.csv diff --git a/benchmark/csv/linguist-samples.csv b/benchmarks/csv/linguist-samples.csv similarity index 100% rename from benchmark/csv/linguist-samples.csv rename to benchmarks/csv/linguist-samples.csv diff --git a/benchmark/csv/linguist-total.csv b/benchmarks/csv/linguist-total.csv similarity index 100% rename from benchmark/csv/linguist-total.csv rename to benchmarks/csv/linguist-total.csv diff --git a/benchmark/histogram/distribution.png b/benchmarks/histogram/distribution.png similarity index 100% rename from benchmark/histogram/distribution.png rename to benchmarks/histogram/distribution.png diff --git a/benchmark/linguist-samples.rb b/benchmarks/linguist-samples.rb similarity index 100% rename from benchmark/linguist-samples.rb rename to benchmarks/linguist-samples.rb diff --git a/benchmark/linguist-total.rb b/benchmarks/linguist-total.rb similarity index 100% rename from benchmark/linguist-total.rb rename to benchmarks/linguist-total.rb diff --git a/benchmarks/parse.sh b/benchmarks/parse.sh new file mode 100755 index 0000000..3baa900 --- /dev/null +++ b/benchmarks/parse.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cd benchmarks/output && go run ../parser/main.go -outdir ../csv && \ +cd ../csv && go run ../parser/main.go -distribution + diff --git a/benchmark/parser/main.go b/benchmarks/parser/main.go similarity index 100% rename from benchmark/parser/main.go rename to benchmarks/parser/main.go diff --git a/benchmark/plot-histogram.gp b/benchmarks/plot-histogram.gp similarity index 63% rename from benchmark/plot-histogram.gp rename to benchmarks/plot-histogram.gp index 7ffd62f..355fb06 100755 --- a/benchmark/plot-histogram.gp +++ b/benchmarks/plot-histogram.gp @@ -1,7 +1,7 @@ #!/usr/bin/env gnuplot set terminal png large font "arial,26" size 1920,1080 -set output 'benchmark/histogram/distribution.png' +set output 'benchmarks/histogram/distribution.png' set datafile separator comma set key under @@ -15,7 +15,7 @@ set bmargin 12 set autoscale set title "Number of files per processing time" -plot newhistogram, 'benchmark/csv/enry-distribution.csv' using 3:xtic(1) title "enry", 'benchmark/csv/linguist-distribution.csv' using 3 title "linguist" +plot newhistogram, 'benchmarks/csv/enry-distribution.csv' using 3:xtic(1) title "enry", 'benchmarks/csv/linguist-distribution.csv' using 3 title "linguist" unset output diff --git a/benchmarks/run-benchmarks.sh b/benchmarks/run-benchmarks.sh new file mode 100755 index 0000000..aa6e1ef --- /dev/null +++ b/benchmarks/run-benchmarks.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir -p benchmarks/output && go test -run NONE -bench=. -benchtime=120s -timeout=100h >benchmarks/output/enry_total.bench && \ +benchmarks/linguist-total.rb 5 >benchmarks/output/linguist_total.bench diff --git a/benchmarks/run.sh b/benchmarks/run.sh new file mode 100755 index 0000000..1ae74cb --- /dev/null +++ b/benchmarks/run.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +benchmarks/run-benchmarks.sh && make benchmarks-slow && \ +benchmarks/parse.sh && benchmarks/plot-histogram.gp diff --git a/benchmark/soft-hard-info.txt b/benchmarks/soft-hard-info.txt similarity index 100% rename from benchmark/soft-hard-info.txt rename to benchmarks/soft-hard-info.txt