项目作者: nickng

项目描述 :
Go overhead measurements
高级语言: Go
项目地址: git://github.com/nickng/go-overhead-benchmarks.git
创建时间: 2018-10-26T17:09:43Z
项目社区:https://github.com/nickng/go-overhead-benchmarks

开源协议:MIT License

下载


go-overhead-benchmarks

Various overhead comparison benchmarks, for guiding
design decisions when using Go as implementation language.

Interface overhead

Tests the overhead of using interface instead of a native type as a map key.
The interface would be used to abstract both a primitive type and a struct.

  1. BenchmarkIfaceOverheadNativePrimitive
  2. BenchmarkIfaceOverheadNativeStruct
  3. BenchmarkIfaceOverheadIfacePrimitive
  4. BenchmarkIfaceOverheadIfaceStruct

String construction

Tests which way of string construction is the fastest.

  1. BenchmarkStringConcat
  2. BenchmarkStringSprintf
  3. BenchmarkStringByteBuf
  4. BenchmarkStringStringBuilder

(Concat < StringBuilder < ByteBuf < Sprintf)