Live data from Hacker News

Gadget: A smallish web framework for Go

redneckbeard.github.io

51–52 of 52 posts

Re: Gadget: A smallish web framework for Go

#51

Earlier quoted context omitted.

> "Handlers are invoked via reflection" That's where I say NO. go's reflect package is slow and a nightmare to use. Go's JSON parser, which uses reflect, is 2.5x slower than Node.js (in my own benchmarks [1]). And Go 1.1 was 3.5x worse that Node.js at parsing JSON. Again, those are my benchmarks, but they seem consistent with what other people are finding (from my Googling around). I would not make this trade off, I…

Your benchmark results look very different from that of the web framework benchmark: http://www.techempower.com/benchmarks/#section=data-r7&hw=i7... In that benchmark Go's JSON performance is almost 3x higher than that of Node. Any reasons why there's such a big difference?

I think it's because they're measuring the rate at which Node.js and Go receive requests, process json, and reply as a single metric.

I measured the speed with which Go and Node.js decode/encode JSON, i.e. there is no network and web server involved, just json.Marshal()/json.Unmarshal() vs JSON.parse()/JSON.stringify()

I benchmarked the web server speed separately.

Re: Gadget: A smallish web framework for Go

#52

Earlier quoted context omitted.

> "Handlers are invoked via reflection" That's where I say NO. go's reflect package is slow and a nightmare to use. Go's JSON parser, which uses reflect, is 2.5x slower than Node.js (in my own benchmarks [1]). And Go 1.1 was 3.5x worse that Node.js at parsing JSON. Again, those are my benchmarks, but they seem consistent with what other people are finding (from my Googling around). I would not make this trade off, I…

Do you have the source code for your benchmarks? Thank you.

Sure, I updated the spreadsheet with links to the code for each benchmark. BSD license. Please keep in mind these were quick and dirty. If you run any of them, please reply with your findings.
Post reply on HN