4 ms·
Performance is the only thing that is holding me back to consider Python for bigger web applications. Of the 3 main languages for web dev these days - Python,
by TekMol 5y ago
Performance is the only thing that is holding me back to consider Python for bigger web applications.
Of the 3 main languages for web dev these days - Python, PHP and Javascript - I like Python the most. But it is scary how slow the default runtime, CPython, is. Compared to PHP and Javascript, it crawls like a snake.
Pypy could be a solution as it seems to be about 6x faster on average.
Is anybody here using Pypy for Django?
Did Clubhouse document somewhere if they are using CPython or Pypy?
- domino 5y agoClubhouse is using CPython
- fnord77 5y agoThe top 5 web app programming languages by market share are PHP, Java, JS, Lua and Ruby.
- TekMol 5y ago...said a stranger on the internet without any sources to back up this claim.
- sdze 5y agoonly one data point though, but... https://redmonk.com/rstephens/2021/08/05/top-20-june-2021/ https://redmonk.com/rstephens/2021/08/05/top-20-june-2021/
- TekMol 5y agoThat one lists the top 5 as: Javascript Python Java PHP C# But is it about web?
- fnord77 5y agosource: https://www.wappalyzer.com/technologies/programming-languages https://www.wappalyzer.com/technologies/programming-language...
- fnord77 5y agolol at the downvotes. sorry your favorite language isn't on the list. I specifically said "market share", not "best" or "favorite". https://www.wappalyzer.com/technologies/programming-languages https://www.wappalyzer.com/technologies/programming-language...
- IshKebab 5y agoTypescript is a nicer language than Python in many ways and it doesn't suffer from Python's crippling performance issues or dubious static typing situation. Plus you can run it in a browser so there's only one language to learn.
- TekMol 5y agoYou cannot run TS in a browser. You can compile it to JS or to Webassembly. But you can do that with every language.
- IshKebab 5y agoYou can't compile TS to WASM, and there's a big difference between just stripping types from TS and transpiling Java or even something like Dart. Way to miss the point.
- franga2000 5y agoTypescript would be nice if it weren't essentially just a bunch of macros for JavaScript. As it is now, as soon as you want to run it, you lose all the benefits of it (including many performance optimizations that could be made in a statically typed runtime) and of course, all the usual footguns of vanilla JS still apply. It's a great development tool though, I'll give you that.
- IshKebab 5y ago> just a bunch of macros for JavaScript It isn't any macros. Not sure what you're talking about. > all the usual footguns of vanilla JS still apply Yeah that does suck but fortunately ESLint and Typescript have options to prevent most of them. If you use Deno they're enabled by default. > including many performance optimizations that could be made in a statically typed runtime Also true, but we're comparing it to PHP and Python.
- mixmastamyk 5y agoBackend controller performance is rarely a bottleneck, and if raw-compute still is there are a number of ways to speed it up, such as cython and/or work queues.
- zinodaur 5y agoI feel like people let go of perf too easily. When using something like Golang, I have apps doing normal CRUD-ish queries at 10k QPS, on 32c/64g machines. For most web apps, 10k QPS is much more than they will ever see, and the fact that it is all done in a single process means you could do really cool things with in-memory datastructures. Instead, every single web app is written as a distributed system, when almost none of them need to be, if they were written on a platform that didn't eat all of their resources.
- jusssi 5y agoPeople have been taught to be irrationally afraid of in-process concurrency (including async). Not too long ago the standard approach for concurrency was "it's hard, don't do it". I've been told off in code review for using Python's concurrent.futures.ThreadPoolExecutor to run some http requests (making the code finish N times faster, in a context where latency mattered) "because it's hard to reason about".
- midrus 5y agoI could rephrase you comment as why would anyone use Go when I could just use assembler or C and keep all into a single node. People don't use python because they want performance. People use python because of productivity, frameworks, libraries, documentation, resources and ecosystems. Most projects don't even need 10k qps, but instead most projects do need an ORM, a migrations system, authentication, sessions, etc. Python has bottle tested tools and frameworks for this.