3 ms·
Ok, but say we use vanilla Python WSGI with a psycopg2 (C Python PostgreSQL extension) directly. Will this come close to the performance of the C++ framework th
by antihero 13y ago
Ok, but say we use vanilla Python WSGI with a psycopg2 (C Python PostgreSQL extension) directly. Will this come close to the performance of the C++ framework thing?
- continuations 13y agoI'd say a vanilla Python application without ORM would perform similar to a flask app without ORM. According to http://www.techempower.com/benchmarks/#section=data-r6&hw=i7&test=db http://www.techempower.com/benchmarks/#section=data-r6&hw=i7... flask (on Gunicorn): 6,138 flask (on PyPy): 8,167 Django + ORM : 4,026 cpoll-cppsp : 114,711 So while a light weight Python app without ORM might be 50% faster than a full-blown Django app, it's still almost 20 times slower than a C++ app. That shouldn't be surprising, by all accounts Python is at least an order of magnitude slower than C++. You could speed up your Python program by running PyPy. According to the benchmark that gives it a 30% speed boost, which is in line with my experience. Another way is to deploy on uWSGI or Meinheld instead of Gunicorn. No matter what you do, Python will not be close to the speed of C++. But what really matters is: is it fast enough for your need?