If so, What is the advantage ? (sure it will avoid restarting webserver). But isn't it a perfomance bottleneck? For production, is it possible to make web2py run directly from bytecode skipping interpreting stage (Caching) (except for the first request) ?
In web2py, by default, all code in models, views and controllers (not web2py code, not code in modules imported by your models, views, controllers) is interpreted at every request. This allows to use a third party web server (for example apache) and still be able to see changes in your code reflected immediately without restart. PHP works in the same way. The performance penalty is negligible because the time to parse your code is less than the time to execute your code.
Anyway, in the admin interface there is a "compile" button that will bytecode compile your code and collapse the view hierarchy (extended and included views) into a single file per action and remove the performance penalty. It also allows you to distribute your code bytecode compiled without giving away the source. The license allows it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With