diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-24 13:21:13 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-24 13:21:13 +0200 |
commit | 29de7735ce2b753539c1444e1f3236a9f2ef58a7 (patch) | |
tree | 0c39eebd660d26e95396c8d4390a71bda5950c43 /bytesconv_timing_test.go | |
parent | Updated best practicies section in README.md (diff) | |
download | fasthttp-29de7735ce2b753539c1444e1f3236a9f2ef58a7.tar.gz fasthttp-29de7735ce2b753539c1444e1f3236a9f2ef58a7.tar.bz2 fasthttp-29de7735ce2b753539c1444e1f3236a9f2ef58a7.zip |
Added benchmark for AppendBytesStr
Diffstat (limited to 'bytesconv_timing_test.go')
-rw-r--r-- | bytesconv_timing_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bytesconv_timing_test.go b/bytesconv_timing_test.go index 688b021..a00ba88 100644 --- a/bytesconv_timing_test.go +++ b/bytesconv_timing_test.go @@ -48,3 +48,13 @@ func BenchmarkEqualBytesStr(b *testing.B) { } }) } + +func BenchmarkAppendBytesStr(b *testing.B) { + s := "foobarbazbaraz" + b.RunParallel(func(pb *testing.PB) { + var dst []byte + for pb.Next() { + dst = AppendBytesStr(dst[:0], s) + } + }) +} |