13 Star 103 Fork 12

gookit/validate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
benchmark_test.go 439 Bytes
一键复制 编辑 原始数据 按行查看 历史
inhere 提交于 2020-09-25 21:37 +08:00 . update some
package validate
import "testing"
func BenchmarkFieldSuccess(b *testing.B) {
v := New(M{
"name": "inhere",
})
v.StringRule("name", "len:6")
b.ResetTimer()
for n := 0; n < b.N; n++ {
_ = v.Validate()
}
}
func BenchmarkFieldSuccessParallel(b *testing.B) {
v := New(M{
"name": "inhere",
})
v.StringRule("name", "len:6")
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
_ = v.Validate()
}
})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/gookit/validate.git
git@gitee.com:gookit/validate.git
gookit
validate
validate
master

搜索帮助