added benchmarks and scripts to run, parse and plot them

moved benchmark/run-slow-benchmarks.sh's content to Makefile
This commit is contained in:
Manuel Carmona
2017-06-28 13:01:36 +02:00
parent 2045abfa41
commit 8d91dc7be8
11 changed files with 872 additions and 18 deletions

View File

@ -3,7 +3,6 @@ package enry
import (
"bytes"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
@ -80,20 +79,3 @@ func (s *EnryTestSuite) TestIsBinary() {
assert.Equal(s.T(), is, test.expected, fmt.Sprintf("%v: is = %v, expected: %v", test.name, is, test.expected))
}
}
const (
htmlPath = "some/random/dir/file.html"
jsPath = "some/random/dir/file.js"
)
func BenchmarkVendor(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = IsVendor(htmlPath)
}
}
func BenchmarkVendorJS(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = IsVendor(jsPath)
}
}