常用方法的基准性能测试:https://github.com/gogf/gf/blob/master/errors/gerror/gerror_z_bench_test.go
$ go test *.go -bench=".*" -benchmem
goos: linux
goarch: amd64
Benchmark_New-4 1890454 589 ns/op 256 B/op 1 allocs/op
Benchmark_Newf-4 1569258 762 ns/op 324 B/op 3 allocs/op
Benchmark_Wrap-4 2012910 600 ns/op 256 B/op 1 allocs/op
Benchmark_Wrapf-4 1600197 749 ns/op 324 B/op 3 allocs/op
Benchmark_NewSkip-4 2009928 579 ns/op 256 B/op 1 allocs/op
Benchmark_NewSkipf-4 1578370 752 ns/op 324 B/op 3 allocs/op
Benchmark_NewCode-4 2060835 591 ns/op 256 B/op 1 allocs/op
Benchmark_NewCodef-4 1603306 752 ns/op 324 B/op 3 allocs/op
Benchmark_NewCodeSkip-4 2047794 584 ns/op 256 B/op 1 allocs/op
Benchmark_NewCodeSkipf-4 1524495 779 ns/op 324 B/op 3 allocs/op
Benchmark_WrapCode-4 1972147 603 ns/op 256 B/op 1 allocs/op
Benchmark_WrapCodef-4 1651316 735 ns/op 324 B/op 3 allocs/op
备案信息: 粤ICP备15087711号-2
Copyright © 2008-2024 啊嘎哇在线工具箱 All Rights.
本站所有资料来源于网络,版权归原作者所有,仅作学习交流使用,如不慎侵犯了您的权利,请联系我们。