基本类型转换性能基准测试:
创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站建设、做网站、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的襄汾网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
john@john-B85M:~/Workspace/GO/GOPATH/src/github.com/gogf/gf/v2/util/gconv$ go test *.go -bench=".*" -benchmem
goos: linux
goarch: amd64
BenchmarkString-4 20000000 71.8 ns/op 24 B/op 2 allocs/op
BenchmarkInt-4 100000000 22.2 ns/op 8 B/op 1 allocs/op
BenchmarkInt8-4 100000000 24.5 ns/op 8 B/op 1 allocs/op
BenchmarkInt16-4 50000000 23.8 ns/op 8 B/op 1 allocs/op
BenchmarkInt32-4 100000000 24.1 ns/op 8 B/op 1 allocs/op
BenchmarkInt64-4 100000000 21.7 ns/op 8 B/op 1 allocs/op
BenchmarkUint-4 100000000 22.2 ns/op 8 B/op 1 allocs/op
BenchmarkUint8-4 50000000 25.6 ns/op 8 B/op 1 allocs/op
BenchmarkUint16-4 50000000 32.1 ns/op 8 B/op 1 allocs/op
BenchmarkUint32-4 50000000 27.7 ns/op 8 B/op 1 allocs/op
BenchmarkUint64-4 50000000 28.1 ns/op 8 B/op 1 allocs/op
BenchmarkFloat32-4 10000000 155 ns/op 24 B/op 2 allocs/op
BenchmarkFloat64-4 10000000 177 ns/op 24 B/op 2 allocs/op
BenchmarkTime-4 5000000 240 ns/op 72 B/op 4 allocs/op
BenchmarkTimeDuration-4 50000000 26.2 ns/op 8 B/op 1 allocs/op
BenchmarkBytes-4 10000000 149 ns/op 128 B/op 3 allocs/op
BenchmarkStrings-4 10000000 223 ns/op 40 B/op 3 allocs/op
BenchmarkInts-4 20000000 55.0 ns/op 16 B/op 2 allocs/op
BenchmarkFloats-4 10000000 186 ns/op 32 B/op 3 allocs/op
BenchmarkInterfaces-4 20000000 66.6 ns/op 24 B/op 2 allocs/op
PASS
ok command-line-arguments 35.356s
网页题目:创新互联GoFrame教程:GoFrame类型转换-性能测试
文章源于:http://www.shufengxianlan.com/qtweb/news18/66218.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联