Hi, We use web2py somewhat differently than most use cases in that we aren't using a database at all, but instead back our web2py app with connections to a server over a local unix RPC socket. We still use web2py to perform validations, and UI generation, so we have a bunch of models that basically contain gluon Field's, and then either call SQLFORM on that model's fields or serialize that model and send it over the wire. More specifically, we have a number of controllers that correspond to a model (controllers/foo.py, and a model/foo.py that we can call SQLFORM on to generate a form), and then we have a single rest.py controller that provides a rest interface to the rpc socket (rest.py basically mirrors all of the controllers with methods defined as: @request.restful(), validates the data using the correct "model", and communicates over the rpc socket)
I've been doing a number of benchmarks recently, and found that while it generally takes ~3.5ms to receive a response over the unix domain socket, calls to the web2py rest controller are taking somewhere around ~80-90ms to return. My suspicion is that this is because web2py is compiling all of the models for every request (running web2py with the profiler seems to corroborate this, indicating that most of the time spent in the response is in compileapp). From my reading it also seems that we can reduce the compilation time of compileapp by using conditional models, however the rest.py controller potentially uses all of them given which method is called in the controller. There also seems to be an undocumented response.models_to_run method that I'm not sure I understand fully. What would be the best way to reduce the response time of this rest.py controller? Can I put response.models_to_run inside each of the controller methods in rest.py, to ensure that only the models we need for the operation are compiled? Am I off track here, and the model compilation is not the source of latency? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.