Hacker News new | ask | show | jobs
by supersillyus 5520 days ago
Faster than Python, better memory use for many types of programs. Compared to Java, less memory use and (I assume) much less start-up time, since no VM is needed. Also, since you can use goroutines, it would seem like you'd be able to do concurrent requests without having to have a special async API like Java/Python have. Go seems like it'll be a pretty great fit for App Engine.
2 comments

goroutines run in a single OS thread. Same reason for blocking threading on Java. Said this restriction maybe lifted in the future but I wouldn't hold my breath on that.

EDIT: Clarification, on goroutines run in a single OS thread on AppEngine.

Goroutines still provide concurrency with a single thread. It's not that useful for CPU-bound stuff, but I'd imagine it should allow multiple concurrent GAE API calls (as they are just IO, and certainly async under the hood), or you could do CPU-bound stuff while waiting for IO.
From a google developer, responding to complaints about the new per-instance pricing: "If you are using Java, we just launched the ability to make your instances multi-threaded allowing you to use fewer instances to handle the same traffic" https://groups.google.com/group/google-appengine/browse_thre...

I'd be surprised if they didn't do the same with Go, by the time it reaches production status.

Faster than CPython maybe, last time someone did a benchmark of Go vs. Python webservers PyPy came out on top.
I'd be interested in a link to that benchmark if you have it.

I assumed that you're talking about http://ziutek.github.com/web_bench/, but that makes no mention of PyPy (other than a HN comment that PyPy takes 2x the memory) and Go comes out on top in that benchmark.

Either way, when saying Go is faster, I wasn't talking specifically about it's http library or io system (I assume both are similar in speed to Pythons). I more meant that if you're going to be writing custom CPU-intensive code to run on App Engine, assuming the same algorithm, Go should be faster. It has better constant factors, and it gives you better control over allocation.

I don't know PyPy well enough to say in what situations it outperforms Go (especially considering that I don't know what kind of VM warm-up you can expect on App Engine), but since GAE doesn't run PyPy, it's not relevant to the discussion of Python v Go on App Engine.

Yep that was the original benchmark, and I ran a PyPy vs. CPython comparison on the same code from which we can extrapolate: http://www.reddit.com/r/Python/comments/fr4w9/benchmarking_g...
And faster doesn't always mean better or more desirable.