First benchmark!

~/s/g/p/g/benchmark$ go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/pelletier/go-toml/v2/benchmark
cpu: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
BenchmarkUnmarshalSimple/v2-8         	 1607115	       742.0 ns/op
BenchmarkUnmarshalSimple/v1-8         	  307977	      3915 ns/op
BenchmarkUnmarshalSimple/bs-8         	  516754	      2330 ns/op
BenchmarkReferenceFile/v2-8           	    9604	    129158 ns/op	  111422 B/op	    1381 allocs/op
BenchmarkReferenceFile/v1-8           	    4521	    263808 ns/op	  130566 B/op	    2649 allocs/op
BenchmarkReferenceFile/bs-8           	    4070	    296271 ns/op	   80784 B/op	    1729 allocs/op
PASS
ok  	github.com/pelletier/go-toml/v2/benchmark	8.139s
This commit is contained in:
Thomas Pelletier
2021-03-24 22:15:12 -04:00
parent ad538d97c9
commit 8a8d1233bb
6 changed files with 455 additions and 2 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ func scanMultilineLiteralString(b []byte) ([]byte, []byte, error) {
switch b[i] {
case '\'':
if scanFollowsMultilineLiteralStringDelimiter(b[i:]) {
return b[:i+3], b[:i+3], nil
return b[:i+3], b[i+3:], nil
}
}
}