6 ms·
Python is generally less performant. Go has a smaller ecosystem. IMHO, YMMV etc.
by Nursie 6y ago
Python is generally less performant.
Go has a smaller ecosystem.
IMHO, YMMV etc.
- jokoon 6y agoYou're right, but: * performance is not really an issue for most software ("97% of the time, premature optimization is evil"). A well designed software doesn't suffer from performance issues with current computer performance, unless you do AI or bleeding edge graphics or science simulation. * there are ways to speed up performance sensitive parts with something else than java, for example by using C/C++, would it be with a python module or cython. Not ideal, but generally you gain performance by adapting your design, not by changing languages. A garbage collector is rarely predictable, hence java is not a good fit for performance. * I remember playing minecraft with friends, and the server was regularly crashing because it was out of memory, or something like that.
- Nursie 6y agoThe OP brought up performance reasons to choose language. :shrug: > I remember playing minecraft with friends, and the server was regularly crashing because it was out of memory, or something like that. I've seen this, but I don't think you can really use one server program running out of RAM as indicative of much. I do still find the pre-setting of max memory on the command line a little bit odd though.
- toomanybeersies 6y agoPre-setting max memory seems odd these days, when everything runs in docker, with its configurable memory limits. Handling process memory usage pre-docker wasn't so easy.
- pydry 6y agoPerformance as an issue is massively overstated in high level languages. CPU intensive hot paths are rarer than people think, I/O performance is a bigger deal than people think and there's more hyper optimized code written in performant languages that you can call directly than most people realize. A lot of graduates think that compsci jobs involve optimizing algorithms or some shit coz they did that type of thing as undergrads, so they port that attitude across. It's also the reason why pypy was massively hyped for a while and then not really used all that much. It was solving the performance problems python never really had.
- Nursie 6y agoIt's true, that the situations in which you care about it are few. The most recent performance issue I've come up against is actually java's startup time, because for reasons unknown my client decided java AWS lambdas were the way to go, has quite a large, complex codebase built around it, and now has complaints about startup latency. I have noticed some younger engineers on C++ projects doing some kooky things "because it's more optimal", and have taken time to explain to them that the micro-optimisations they're using impact readability, are going to be done by the compiler anyway if they're at all useful, and are likely to be several orders of magnitude less relevant than some lock somewhere, or a bit of IO, or whatever.
- CodeGlitch 6y ago> I remember playing minecraft with friends, and the server was regularly crashing because it was out of memory, Could be a problem with the logic/design of the server rather than a problem with Java? Despite memory being GC'd, you can still run out of it if you just keep allocating stuff. The important thing about Java is that it doesn't suffer from the usual C or C++ memory exploits.
- TheCoelacanth 6y agoI don't think I've ever worked on an application where performance wasn't a problem. The ability of programmers to write slow software grows faster than computing power does. > well designed software Ah, there's my problem. Maybe at some point I'll get a chance to work on one of those.
- bluetomcat 6y agoPython code which uses stuff mostly from the standard libraries isn't really that slow. Parsing a JSON? Call a wrapped C function. Process a media file? Call a wrapped C function. If you keep the actual CPU-intensive stuff in C code, the ops executed by the Python interpreter can be negligent.
- michaelt 6y agoThat Python's performance doesn't matter because you can write things in C instead is faint praise indeed.
- BiteCode_dev 6y agoYou don't need to write it. The ecosystem is already chock full of compiled extensions. That's kinda the point.
- BiteCode_dev 6y agoYes, but that's my point. If I don't need performance, Python is ok. If I do, I won't go Java, I will choose something that is built for performance. Python is good enough for 99% of my performances need. The last 1%, jumping to java is not a big difference, I'll use rust or go. I won't use go for the ecosystem, but it's unique characteristics: easy concurrency, dead simple binary production. Java can't beat that. IF I need an huge ecosystem, I'll go Python. For the need for Java, I would need this very specific sweet spot where I need just enough speed, and just a rich ecosystem enough to justify it, and nothing that is a killer feature in alternatives. And a situation where compromise over this is not possible. It never happens to me, that's all.
- _pmf_ 6y ago> The last 1%, jumping to java is not a big difference That's where you're wrong, kiddo.
- BiteCode_dev 6y agoOh, I'm afraid I can't claim that sobriquet anymore unfortunately. But that's not the point. The point is that, for the 99%, staying on a slower language is ok. For the last 1%, I'll skip Java and go to Rust/Go. If I have to do a rewrite for perf sake, I'm not going to go half way.
- bjourne 6y agoBut you are not going to get higher performance in Rust/Go.
- BiteCode_dev 6y agoRust can literally contain inline asm so yes, you will. But even without that, the startup time is always going to be faster. And for IO, you will get faster perf in Go more easily. Sure, you can finely tune your Java code to get there, but it's a lot harder. It in both cases it will eat up way more memory. There is a reason Google, that did use heavily Java internally, is now moving to Go, a language they custom designed for concurrency.
- Brian_K_White 6y agoHow did you manage to miss the entire point of the comment?
- Nursie 6y agoI didn't, thanks. I think that there are use-cases in which java is more performant than his low-performance options, and can be as performant as his high-performance options, while providing a much larger ecosystem. I think the parent poster actually makes a very weird set of choices - "when my high level choice, python, is not cutting the mustard, I am happy to throw away breadth of support entirely in the name of optimisation." It's up to him what his preferences are, of course, I'm not saying they're wrong as much as personal.
- Brian_K_White 6y agoEh, kinda still sounds like you did. Thanks for removing any doubt.
- Nursie 6y agoPerhaps you could enlighten me then? Rather than just posting low-effort, content-less, drive-by snark? The OP even says they're just posting their own selection criteria in other comments.
- Brian_K_White 6y agoProbably I can't.
- Nursie 6y agoThanks for your constructive input to the discussion then.