Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks, why is Ozzo the worst? #137

Open
frederikhors opened this issue Nov 27, 2020 · 6 comments
Open

Benchmarks, why is Ozzo the worst? #137

frederikhors opened this issue Nov 27, 2020 · 6 comments

Comments

@frederikhors
Copy link

Can I ask you why is Ozzo the worst in these benchmarks?

https://github.com/frederikhors/bench-golang-validators

goos: windows
goarch: amd64
pkg: benchGolangValidators
BenchmarkAsaskevich-8              94460             12505 ns/op            5439 B/op         72 allocs/op
BenchmarkPlayground-8             704642              1784 ns/op             227 B/op         14 allocs/op
BenchmarkSaddam-8                  97534             12125 ns/op            1858 B/op         68 allocs/op
BenchmarkBuffalo-8                235267              5033 ns/op             756 B/op         15 allocs/op
BenchmarkOzzo-8                    14416             81325 ns/op            5653 B/op        112 allocs/op
PASS
ok      benchGolangValidators   7.300s
@frederikhors
Copy link
Author

Maybe because of asaskevich/govalidator#413?

@frederikhors
Copy link
Author

@qiangxue can I ask you if I wrote a wrong benchmark?

@yyong37
Copy link

yyong37 commented Dec 9, 2020

#104 @frederikhors

@frederikhors
Copy link
Author

@rizzi37 yes, thanks, I read that. But I'm using the latest version (where is fixed) and I'm not using email. How can you explain it? For this I am asking.

@ganigeorgiev
Copy link

@frederikhors your test repo seems to use is.Email, which also checks if the MX record exists for the email domain. You could try replacing it with just is.EmailFormat, which only checks the string format.

@frederikhors
Copy link
Author

@ganigeorgiev You're right, but it's still high:

BenchmarkAsaskevich-8   	   82749	     13119 ns/op	    5452 B/op	      72 allocs/op
BenchmarkPlayground-8   	  705242	      1808 ns/op	     228 B/op	      14 allocs/op
BenchmarkSaddam-8       	   93002	     13140 ns/op	    1854 B/op	      68 allocs/op
BenchmarkBuffalo-8      	  203504	      5042 ns/op	     760 B/op	      15 allocs/op
BenchmarkOzzo-8         	  176402	      6674 ns/op	    5093 B/op	      99 allocs/op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants