On 10 Dec 23:49, Vincent Bastos wrote: > Hi, > > I was wondering whether there was an old thread regarding the core design > choice for the amount of network requests made by the GTK client? > > I feel that this is a relevant question in light of the fact that the > community is pushing for a generic web client. > > I noticed that for each view the client makes many calls to the server, I > find that this goes against best practice principals as network requests > are expensive. > > Is the answer simply that it is much easier to develop a generic client in > this way? > > To be honest I have not monitored the GTK network requests; I am actually > going off what I noticed in the SAO client. > > I noticed that for the party view for example lots of calls are made for > each of the different models requests. > > Wouldn't it be better to have a single end point for party that would > provide all the required data in a single response rather than a number of > response. > > I have not had a look at the code for the GTK client at all, so I guess my > next step is to look at that first to understand how it works.
sao is not yet optimized to minimize the number of requests. Mainly it is missing the cache that tryton has for views, toolbar and keyword. Otherwise when the views are in the cache, opening from a menu an action should result of those requests: - get the ir.action to perform (if not in the cache) - get the view (if not in the cache) - search the record to load - read the visible records This is the result of a compromise between the flexibility of the client and the minimizing of requests. For a form view, it will depend on the number of xxx2many field it contains because it will perform a "read" for each one. This is a compromise between the complexity of the code and the performance. Trying to merge all those calls will result in a much more complex code with probably much more bugs. Also sao is missing a optimization to not read xxx2many that are not yet displayed. And also it misses the preloading of the views for xxx2many. So at the end, normally sao should make the same amount of request as tryton does. And for now, sao should look quite similar to the "tryton --dev" as it doesn't have any cache. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/