We should definitively try to understand and improve these results but I am not convinced that matching the speed of others on "hello world" benchmarks should be a goal. This just says to me that others do very little for you beyond the web server. If you turn on sessions and templates in other frameworks (except wheezy perhaps) you lose most of the advantage. If one really need something so barebone, one should just use wsgi.
Here is an example... one month ago a user with uWSGI+web2py had a problem. People with iPad devices accessing the site where having their sessions mixed up. They would go to the site and find themselves logged in as other users. We tried to understand it and found that he was using a buggy version of uWSGI that was caching cookies. This was due to the fact that iPad devices has IPv6 addresses that were not properly parsed and appear as "unkown". uWSGI was passing to web2py cached session cookies with "unkown" client ip. I order to prevent this we decided not to trust the web server and add a client ip validation in web2py. Other frameworks do not validate the client ip. Should we forfeit these checks because others do not do them and we want to appear faster in the benchmarks? I say no. Massimo On Wednesday, September 26, 2012 11:21:41 AM UTC-5, Alec Taylor wrote: > > On Thu, Sep 27, 2012 at 12:12 AM, Massimo Di Pierro > <massimo....@gmail.com<javascript:> > > wrote: > >> First of all kudos to Andriy, >> >> He created an excellent testing code, he was very responsive, and he >> really took the time to understand some of the web2py code. Moreover he is >> the author of the excellent wheezy.web framework. >> >> He just emailed me that he has rebuilt his testing environment and has >> updated the benchmarks: >> >> http://mindref.blogspot.com/2012/09/python-fastest-web-framework.html >> >> The memory leak is gone! I am not sure about the cause but I suspect he >> had an older web2py version installed via pip that was creating problems. >> >> We still score last but the numbers are closer to the numbers that >> Niphlod got. Anyway, this is not a concern to me because although this is a >> simple "hello world" test, web2py does more than the others (session, T, >> url and ip validation, etc.) and it is expected to be slower. The >> difference, as Niphlod sasys, washes away in real life applications. Yet we >> can probably do better with some simple tweaks and we should pursue >> that. Niphlod numbers still look better by almost a factor 2 so something >> else is going on too. >> >> Andriy also posted template benchmarks: >> http://mindref.blogspot.com/2012/07/python-fastest-template.html >> >> So if we compare web2py with Django you see that web2py is slower on >> "hello world" but has faster templates. As you can see the time to render >> one template page dominates the time to serve "hello world". Of course >> wheezy.web smokes everybody else on both tests and that is something we >> should try understand. We should also try port gluino to wheezy.web. >> >> Massimo >> > > Thanks Massimo, I saw Andriy posting on comp.lang.python and recommended > he benchmark web2py. > > Would be very interested to see if web2py can catchup to the others. I > think that the performance when compared with Flask should be our main goal. > > Definitely a port of gluino to wheezy.web would be amazing :) > --