QT talent pool and ecosystem is a rounding error compared to what we have with the web ecosystem. If you want to make something with medias, graphs, a few custom widgets, a reactive layout and deep routing, it will take 10 to 30 times longer with QT.
I myself prefer the snapiness of QT apps, but budget and time to market will win.
Electron apps are always resource hogs, frequently slow and generally integrate extremely poorly. As a consumer I care not one whit for how large the "talent pool" for the web ecosystem is, I care about how terrible the application is.
As a developer I must say calling it talent is in most cases a huge stretch, as I do believe you can probably make something in Electron that performs passably, integrates passably and will still be a resource hog. The reason we see basically none of this is because people simply don't care to engineer these applications well. "It's just the browser", after all. Why look deeper?
Sure but most teams do the maths for the cost/benefit ratio and make the call.
In this context the argument is moot: a better app that is too expensive or slow to make is simply not going to be released vs the worse one that actually gets published.
That's all there is to it.
That's why people still use wordpress, excel or jupyter notebooks for important stuff.
You may want things to be different, and for good reasons, but it's still what's the market has decided.
Well yes, the Goodwin point is now crossed very casually, just like people are using superlatives for the mundane things, such as "I ate the most amazing fries yesterday".
This makes for poor debates, where there is little nuance, fuzzy scales and hardly meaningful communication.
There are plenty of things for which python is not slow, but people using python don't know a lot about programming, and end up with a slow result.
A couple of advises:
- the right algo will go a long, long way.
- know your data structures. E.G: assigning to a slice is ridiculously fast (even while unpacking), memory views may save a lot on byte heavy workloads, heapq and deque are underrated, etc. Also check out https://wiki.python.org/moin/TimeComplexity for big O notations on python builtin types common operations to understand what you pay for.
- know the stdlib. collections, itertools and functools all contain incredible gems.
- delegate. Python is a fantastic glue language, use it for what it's good at. Your database, your numpy arrays, your cache are all amazing are what they do, no matter the language. Let them do the heavy work.
- don't kill good perfs by ignorance. I regularly see people casting a generator, iterating on a dataframe, calling readlines() on a file or doing something else that is destroying the otherwise excellent perfs of their program.
- know the ecosystem. There are some very good fast libs out there: diskcache, sortedcontainer, scipy, uvloop...
- use threads to avoid blocking a GUI, multiprocess to share work between CPU and asyncio to speed up network operations. Each tool has a sweet spot. But threads are underrated, they work well for a couple of hundred parallel network operations, and most C libs will actually release the GIL, so they can use several CPU more often than you'd thin. Also, use pools if you can, shared_memory in 3.8 or mmap.
- sometime the dirty solution is just faster, like subprocessing to ffmpeg.
- The more recent, the slower. Sure, I love statistics, pathlib and dataclasses. In a regular code they are great. On a bottleneck however, they are very slow.
- the array module is not supposed to speed up the code, only save memory. But sometimes it does.
- printing to the terminal is limiting. Sometime your program is doing fine, the display is preventing it to go faster. At least check the flush.
- comprehensions are faster than alternatives.
- pre-allocating lists and dicts can help.
- measure. The austin profiler is your friend.
- rewriting the hot path in a faster language is likely more interesting than writing the whole program in it. A bit of nim or rust is easy to call from python.
A big thank you! This is an amazing list of things to look into and keep in mind. Many points are obscure to me, but I'm going to print this and keep it at hand. Thanks again.