Closed hypebeast closed 9 years ago
I'm going to add this to the next round of benchmarks. Initial performance results are extremely promising.
Some questions/suggestions:
LoadHTMLTemplates()
with the templates directory? (If not, we should switch to this to keep the style as similar as possible across versions.)MARTINI_ENV=production
. Does Gin look for Martini's env variables for compatibility? Or is this a typo?gin.H
convenience shortcut, which looks nice because it can potentially help with the ugliest part of the Martini code, which was having to create a custom struct just to pass the data along. So unless I am mistaken I believe we can do replace that context creation with something such as context := gin.H{"Title": title, "Members": members}
? Or actually even use gin.H
instances entirely and get rid of the custom types? (This would be much cleaner and similar to what we are doing in other languages.)All of these benchmarks are tricky to to get right, but it's worth mentioning that all the solutions today do mount a static middleware that run for each request.
I just updated the PR.
LoadHTMLGlob()
instead of parsing the templates manually. The LoadHTMLTemplates()
is deprecated.GOMAXPROCS=4 GIN_MODE=release go run server.go
.FYI I am working towards integrating this in PR #8, if you wish to follow along!
Hi Matthew,
I added a Gin (https://github.com/gin-gonic/gin) based benchmarker to the project. Gin is a more Go idiomatic Sinatra style microframework for Go. I think it would be a good addition to this showdown.
On my machine I got the following results:
Compared to Martini: