codecamp

GoFrame 错误处理-性能测试

常用方法的基准性能测试: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


GoFrame 错误处理-其他特性
GoFrame 数据校验-基本介绍
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

GoFrame 核心组件

GoFrame 核心组件-数据库ORM

GoFrame 模块列表

GoFrame 模块列表-单元测试

GoFrame 模块列表-功能调试

GoFrame WEB服务开发

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }