TechEmpower analysed the performance of many web frameworks, web2py included

111 views
Skip to first unread message

Antonio Salazar

unread,
Feb 1, 2016, 2:23:40 AM2/1/16
to web2py-users
It doesn't look good on web2py, we're consistently in the last places. Other python frameworks like Django or Flask fared better.

Test source is here:

It was tested on Linux with MySQL using the integrated Rocket server.

Anthony

unread,
Feb 1, 2016, 8:28:11 AM2/1/16
to web2py-users
This isn't even close to a fair comparison, particularly against other Python frameworks such as Django and Flask. The web2py code and setup are not representative of how a web2py app would be deployed in production, and the web2py app is doing more than the other apps (e.g., displaying the full web2py "welcome" app front end layout). Here is a list of changes that would speed up web2py and make the app more comparable to the Django and Flask examples:
  1. Serve web2py via a production web server such as nginx/uwsgi or gunicorn (as the Django and Flask apps are).
  2. Set reload=False in AppConfig() -- no reason to read the file on every request.
  3. Set fake_migrate_all=False in the DAL setup -- this would never be True (even in development it is only used in special cases).
  4. Set lazy_tables=True in the DAL setup. Even better, use conditional models so tables are only defined when needed.
  5. Disable web2py sessions, as they are not needed for the benchmark tests and not used in the other frameworks.
  6. Do not extend the "welcome" app layout -- just render a minimal HTML page, similar to the one Flask uses.
  7. Compile the application, which would typically be done in production.

The current web2py app is so far off from what would be deployed in production, it would be much more appropriate to simply remove it from the benchmarks altogether rather than leave it as is.


Anthony

Antonio Salazar

unread,
Feb 1, 2016, 10:00:26 AM2/1/16
to web2py-users
They are accepting code contributions for the test app, although we would have to wait for round 12 to see the results.
Reply all
Reply to author
Forward
0 new messages