4 ms·
when/where is Go faster than Python?
by wnevets 12y ago
when/where is Go faster than Python?
- nkozyra 12y agoIt's a statically-typed and compiled language, by most accounts you can expect it to be faster in a lot of places. This has more to do with the interpreter, of course, you can compete with PyPy.
- scott_s 12y agoSince they mention "scalability", I think they're more concerned with the fact that Go has concurrency baked into the language. Python does not.
- voidlogic 12y ago1. Go, being a statically compiled language/having a closer to the metal memory model, generally has higher single threaded performance. 2. Go allows true concurrency in many situations Python cannot (due to GIL etc); Go also supports lightweight threads that are multiplexed over actual OS threads. 3. Go makes it easier to control and reason about heap allocations. 4. Go is even easier than Python to integrate with C/ASM code.
- dragonwriter 12y ago> 2. Go allows true concurrency in many situations Python cannot (due to GIL etc); It would be more accurate to say that Go allows parallelism in situations where Python (in the standard implementation, at least) does not. Calling parallelism (what the GIL prevents) "true concurrency" isn't particularly helpful.
- voidlogic 12y agoTrue, I was imprecise. Thanks.
- alexbardas 12y agoGo has a much better runtime system than Python (can spawn lots of green threads in parallel using goroutines), but it's also broken in so many ways (e.g.: type system).