The honest thing would be to say "yes, Python is slow, but you can use some fast modules written in C".
You can even go farther and say that if you're going to use Python for non-trivial projects you better learn C (or some C generator like Cython).
The honest thing would be to say "yes, Python is slow, but you can use some fast modules written in C".
You can even go farther and say that if you're going to use Python for non-trivial projects you better learn C (or some C generator like Cython).
For a normal web application the request flow goes something like: nginx (WSGI) -> uwsgi -> web application code -> psycopg2 driver -> postgres. Only the web application part is written in Python, so for practical purposes you actually have a C stack that uses Python for business logic. Loads of libraries, from json parsers to templating libraries include optional C code for speedups.
The whole rise of memcached and NoSQL should pretty clearly indicate that many developers are finding their database to be the bottleneck.
There's much less of a push for high performance languages, even though there are many that are also quite nice to work with (eg, Clojure). Since this is a Python discussion, searching for "Django PyPy" and "Django NoSQL" should be instructive.
You're combining a false dichotomy with snark, which really shouldn't have a place here on HN.
And if you really have these performance characteristics (hint: it's unlikely), maybe it's time to get a edge caching CDN? Cutting 400ms of latency as you cross from Amsterdam to California is going to be the easiest performance boost you ever got
If I build an application in Java and Python, with the same database backend, running the exact same set of SQL queries, the Java application should perform better.
E.g. a DB that fits in RAM is different, of course. It is hence easy to create benchmarks that generates every possible result.
So is your comment relevant to my point? Is there something about that benchmark which contradict the previous thumbs rule?
(And yes... With lots of calculations, scripting languages aren't a good idea either in many cases. Also obvious.)
If processing speed is needed... well, note that databases are seldom written in scripting languages.
That overhead is the price you pay for using Python so it's what matters when you compare languages for CPU bound projects.
I think interpreter overhead and language ecosystem performance are probably best looked at as separate questions.