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

About V5 Benchmarks #2314

Open
zxysilent opened this issue Oct 25, 2022 · 4 comments
Open

About V5 Benchmarks #2314

zxysilent opened this issue Oct 25, 2022 · 4 comments
Labels

Comments

@zxysilent
Copy link

About V5 Benchmarks

@aldas
Copy link
Contributor

aldas commented Oct 25, 2022

Could you be more specific?

@zxysilent
Copy link
Author

https://github.com/labstack/echo#benchmarks

about v5 vs v4 or gin

@lammel lammel added the docs label Nov 30, 2022
@lammel
Copy link
Contributor

lammel commented Nov 30, 2022

https://github.com/labstack/echo#benchmarks

about v5 vs v4 or gin

I guess you'd like to see updated benchmarks on the V5 branch
There is some discussion going on about benchmarks in #2143

When V5 is released the benchmarks will be updated.
For now you can check pull requests for the V5 branch, which include benchmarks as part of the automated tests or fork https://github.com/vishr/web-framework-benchmark and add the versions you need and benchmark yourself.

@lammel
Copy link
Contributor

lammel commented Nov 30, 2022

Ok I have to admit I was interested too in numbers :)
Forked to https://github.com/lammel/web-framework-benchmark to use current versions for Gin and Echo v4.
Tested using go1.19.3 linux/amd64

Benchmarks using Echo v4:

Version:
	github.com/gin-gonic/gin v1.8.1
	github.com/labstack/echo/v4 v4.9.1

sh# go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/lammel/web-framework-benchmark
cpu: AMD Ryzen 7 2700X Eight-Core Processor         
BenchmarkEchoStatic-16       	   31438	     36312 ns/op	    2328 B/op	     157 allocs/op
BenchmarkEchoGitHubAPI-16    	   20865	     53327 ns/op	    3242 B/op	     203 allocs/op
BenchmarkEchoGplusAPI-16     	  373552	      2742 ns/op	     193 B/op	      13 allocs/op
BenchmarkEchoParseAPI-16     	  231984	      5056 ns/op	     352 B/op	      26 allocs/op
BenchmarkGinStatic-16        	   24606	     44174 ns/op	    8223 B/op	     157 allocs/op
BenchmarkGinGitHubAPI-16     	   17478	     64280 ns/op	   10714 B/op	     203 allocs/op
BenchmarkGinGplusAPI-16      	  325278	      3491 ns/op	     727 B/op	      13 allocs/op
BenchmarkGinParseAPI-16      	  180774	      6489 ns/op	    1434 B/op	      26 allocs/op
PASS
ok  	github.com/lammel/web-framework-benchmark	14.254s

Benchmarks using Echo v5 (v5_alpha branch):

Version:
	github.com/gin-gonic/gin v1.8.1
	github.com/labstack/echo/v4 (locally replaced with branch v5_alpha at 7402266)

sh# go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/lammel/web-framework-benchmark
cpu: AMD Ryzen 7 2700X Eight-Core Processor         
BenchmarkEchoStatic-16       	   29661	     38733 ns/op	    2392 B/op	     157 allocs/op
BenchmarkEchoGitHubAPI-16    	   20264	     56995 ns/op	    2465 B/op	     203 allocs/op
BenchmarkEchoGplusAPI-16     	  341821	      3153 ns/op	     202 B/op	      13 allocs/op
BenchmarkEchoParseAPI-16     	  211303	      5759 ns/op	     366 B/op	      26 allocs/op
BenchmarkGinStatic-16        	   24391	     45088 ns/op	    8230 B/op	     157 allocs/op
BenchmarkGinGitHubAPI-16     	   17371	     63466 ns/op	   10720 B/op	     203 allocs/op
BenchmarkGinGplusAPI-16      	  270980	      3750 ns/op	     686 B/op	      13 allocs/op
BenchmarkGinParseAPI-16      	  175144	      6791 ns/op	    1440 B/op	      26 allocs/op
PASS
ok  	github.com/lammel/web-framework-benchmark	13.381s

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

No branches or pull requests

3 participants