3 ms·
In terms of general compute speed Go is many times faster than Python - approximately on a par with Java speed-wise but with much less memory use. That means yo
by zik 7y ago
In terms of general compute speed Go is many times faster than Python - approximately on a par with Java speed-wise but with much less memory use. That means your server costs are many times cheaper and your page latencies are much faster than Python. It's significant.
- PretzelFisch 7y agoIn the past companies would just compile python down to c to get the memory and perf they need. Probably would be the right answer here too, but that would not look as cool on the resume.
- WoodTree 7y agoBy compiling you mean rewriting it in C or Cython. Which is only a good idea for certain applications.
- PretzelFisch 7y agoyeah, I was thinking of Cython getting used. Anly particular reason it would not work for this kind of use case?
- _ph_ 7y agoMoving compute intensive tasks to C would speed up many programs. That is the reason that many dynamic languages have overall good performance - they rely on C libraries for the computative heavy lifting. This has one big backdraw however. Not only do you need to write in two different languages, the rewriting in C requires a lot of care, as the language protects you much less than the high level language you implement for. One big attraction of Go is, that it is high level and productive enough, to be the main implementation language, and for time critical stuff very efficient. So you don't have to cross language bareers to implement speed critical code and you get the full type and memory safety in the whole stack. Interestingly, one can write Python extensions in Go, so in most cases that would be my choice these days for speeding up critical code paths in Python.
- AtlasBarfed 7y agoI thought Go's GC was more wasteful of memory than Java's b/c of the focus on reduced pause times.
- zik 7y agoNo, not at all. Go uses the stack for most variables so it's a lot less heavy on GC than Java.