Skip to content

Instantly share code, notes, and snippets.

@noahgoldman
Created April 9, 2018 18:53
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 noahgoldman/034fb2a52aadd60c383321fe9d3a4ba3 to your computer and use it in GitHub Desktop.
Save noahgoldman/034fb2a52aadd60c383321fe9d3a4ba3 to your computer and use it in GitHub Desktop.
Performance of importsrv with different hash methods

Reduced allocations (fasthash/fnv1a)

goos: darwin
goarch: amd64
pkg: github.com/stripe/veneur/importsrv
BenchmarkImportServerSendMetrics/InputSize=10-8                   100000             14391 ns/op            4360 B/op         31 allocs/op
BenchmarkImportServerSendMetrics/InputSize=100-8                   50000             36363 ns/op            5464 B/op        120 allocs/op
BenchmarkImportServerSendMetrics/InputSize=1000-8                  10000            135716 ns/op           25305 B/op        487 allocs/op
BenchmarkImportServerSendMetrics/InputSize=10000-8                  2000            923453 ns/op          208295 B/op        821 allocs/op
PASS
ok      github.com/stripe/veneur/importsrv      7.117s

Using strings and MetricKey

goos: darwin
goarch: amd64
pkg: github.com/stripe/veneur/importsrv
BenchmarkImportServerSendMetrics/InputSize=10-8                   100000             16947 ns/op            6609 B/op         82 allocs/op
BenchmarkImportServerSendMetrics/InputSize=100-8                   30000             62696 ns/op           27873 B/op        620 allocs/op
BenchmarkImportServerSendMetrics/InputSize=1000-8                   5000            383437 ns/op          249130 B/op       5488 allocs/op
BenchmarkImportServerSendMetrics/InputSize=10000-8                   500           3277424 ns/op         2448340 B/op      50822 allocs/op
PASS
ok      github.com/stripe/veneur/importsrv      8.316s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment