Skip to content

Instantly share code, notes, and snippets.

@sdboyer
Last active February 2, 2017 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdboyer/e719c9fa5896011d4a58456d4d3a19de to your computer and use it in GitHub Desktop.
Save sdboyer/e719c9fa5896011d4a58456d4d3a19de to your computer and use it in GitHub Desktop.
~/ws/go/src/github.com/Masterminds/semver 2.x* ⇣
❯ go test -bench=. -benchmem
BenchmarkNewConstraintUnary-8 300000 4101 ns/op 1088 B/op 10 allocs/op
BenchmarkNewConstraintTilde-8 300000 5190 ns/op 1200 B/op 10 allocs/op
BenchmarkNewConstraintCaret-8 300000 5158 ns/op 1200 B/op 10 allocs/op
BenchmarkNewConstraintWildcard-8 300000 4196 ns/op 1237 B/op 13 allocs/op
BenchmarkNewConstraintRange-8 200000 11089 ns/op 2374 B/op 20 allocs/op
BenchmarkNewConstraintUnion-8 100000 12984 ns/op 3184 B/op 31 allocs/op
BenchmarkValidateVersionUnary-8 50000000 32.8 ns/op 0 B/op 0 allocs/op
BenchmarkValidateVersionUnaryFail-8 20000000 117 ns/op 160 B/op 1 allocs/op
BenchmarkValidateVersionTilde-8 30000000 59.2 ns/op 0 B/op 0 allocs/op
BenchmarkValidateVersionTildeFail-8 10000000 152 ns/op 288 B/op 1 allocs/op
BenchmarkValidateVersionCaret-8 30000000 57.5 ns/op 0 B/op 0 allocs/op
BenchmarkValidateVersionCaretFail-8 10000000 164 ns/op 288 B/op 1 allocs/op
BenchmarkValidateVersionWildcard-8 30000000 57.7 ns/op 0 B/op 0 allocs/op
BenchmarkValidateVersionWildcardFail-8 10000000 166 ns/op 288 B/op 1 allocs/op
BenchmarkValidateVersionRange-8 20000000 58.0 ns/op 0 B/op 0 allocs/op
BenchmarkValidateVersionRangeFail-8 10000000 152 ns/op 288 B/op 1 allocs/op
BenchmarkValidateVersionUnion-8 5000000 291 ns/op 304 B/op 2 allocs/op
BenchmarkValidateVersionUnionFail-8 3000000 531 ns/op 528 B/op 5 allocs/op
BenchmarkNewVersionSimple-8 2000000 805 ns/op 320 B/op 2 allocs/op
BenchmarkNewVersionPre-8 1000000 1107 ns/op 320 B/op 2 allocs/op
BenchmarkNewVersionMeta-8 1000000 1146 ns/op 320 B/op 2 allocs/op
BenchmarkNewVersionMetaDash-8 1000000 1297 ns/op 320 B/op 2 allocs/op
BenchmarkAdjacentRangeUnion-8 1000000 1986 ns/op 2208 B/op 15 allocs/op
BenchmarkAdjacentRangeUnionMethod-8 3000000 518 ns/op 768 B/op 4 allocs/op
BenchmarkDisjointRangeUnion-8 1000000 1538 ns/op 1504 B/op 13 allocs/op
BenchmarkDisjointRangeUnionMethod-8 1000000 1408 ns/op 1632 B/op 11 allocs/op
BenchmarkOverlappingRangeUnion-8 500000 2554 ns/op 2784 B/op 18 allocs/op
BenchmarkOverlappingRangeUnionMethod-8 1000000 1208 ns/op 1536 B/op 8 allocs/op
BenchmarkUnionUnion-8 500000 2862 ns/op 2000 B/op 16 allocs/op
BenchmarkUnionUnionMethod-8 500000 2960 ns/op 2032 B/op 17 allocs/op
BenchmarkSubsetRangeIntersection-8 3000000 471 ns/op 576 B/op 3 allocs/op
BenchmarkSubsetRangeIntersectionMethod-8 5000000 363 ns/op 384 B/op 2 allocs/op
BenchmarkDisjointRangeIntersection-8 5000000 371 ns/op 384 B/op 2 allocs/op
BenchmarkDisjointRangeIntersectionMethod-8 5000000 265 ns/op 192 B/op 1 allocs/op
BenchmarkOverlappingRangeIntersection-8 3000000 460 ns/op 576 B/op 3 allocs/op
BenchmarkOverlappingRangeIntersectionMethod-8 5000000 352 ns/op 384 B/op 2 allocs/op
BenchmarkUnionIntersection-8 2000000 960 ns/op 0 B/op 0 allocs/op
BenchmarkUnionIntersectionMethod-8 2000000 951 ns/op 0 B/op 0 allocs/op
PASS
ok github.com/Masterminds/semver 67.450s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment