View Single Post
Old 05-13-2022, 04:19 PM  
wankawonk
Confirmed User
 
Industry Role:
Join Date: Aug 2015
Posts: 1,018
One thing to remember is that a python (or nodejs) server-side app is spending 99% of its compute time on external software implemented in C

Python is just a little bridge between the web server (nginx, apache) and the database, which are both (probably/usually) written in C (nginx is C).

All python is doing, is parsing some parameters out of the request, using those params to compose and execute some database calls, and then rendering the database response into an HTML template (which is then passed back to nginx)

So it really doesnt matter, *at all*, that python is slow and bloated as hell. 99% of the work is done in external software implemented in C.

Incidentally, even within python, a lot of the libraries are implemented in C. Scientific computing in python (numpy) runs at C speeds because the actual library is implemented in C and loaded directly into the python runtime (which is also implemented in C).

Python (and any modern framework) really just stitches together a whole lot of C code.

I hate ruby/rails and yes, its slow and bloated just like python, but again, 99% of compute time in a rails app is spent outside the ruby runtime.

Now I'm just rambling -- but python can easily look like a joke to a Java developer because of the global interpreter lock. It literally doesn't support threads at the OS level. That seems insane until you realize that in a python server app, nginx is acting as a proxy in front of many python processes. It doesn't matter that each process is limited to a single OS thread -- we're simply using a completely different paradigm than a Java developer is used to.
wankawonk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote