3 ms·
Go is much better at responding with large amounts of data when the database call is eliminated. I can only assume its ability to deal with large strings is lea
by tuxychandru 14y ago
Go is much better at responding with large amounts of data when the database call is eliminated. I can only assume its ability to deal with large strings is leaps and bounds superior to v8 which makes sense to me.
In my own micro-benchmark, I've seen that BSON decoding takes big chunk of time when using mgo. That should explain why the go version got faster when DB access was removed.
This shouldn't come as a surprise as the node.js driver uses a BSON parser written in C++ by default.
- rartichoke 14y agoIt wasn't just a small difference though. The difference between returning 10kb of json from a function vs 10kb of json from mgo was insanely different. I don't think it's because the bson C++ implementation is so much faster than Go. I think it's because Go is clearly faster than JS but it doesn't matter once you introduce db calls. It's sort of like using "for in" vs "for" in JS in the browser. It doesn't really matter which one of them might be faster than the other, as soon as you touch the DOM the difference becomes meaningless and if you jsperf it with DOM touching the results will be the same.