On 07 May 12:03, Cédric Krier wrote:
> On 07 May 02:24, hendrik.brande...@googlemail.com wrote:
> > Hello,
> > 
> > I have been successfully implemented a tryton 3.2 installation and have a 
> > problem regarding the Record.expr_eval method of the client: If I use the 
> > client out of the box without modifications, displaying our chart of 
> > accounts takes a long time if we drill-down to level 4 or deeper. Used 
> > chart of accounts is the german SKR03. 
> > 
> > After reading the source and perform some debugging sessions, I found out, 
> > that the following part of the Record.expr_eval ( 
> > http://hg.tryton.org/tryton/file/88501503f5b9/tryton/gui/window/view_form/model/record.py#l502
> >  
> > ) is responsible for the performance issue:
> > 
> >         ctx['context'].update(self.context_get())
> >         ctx.update(self.get_eval())
> > 
> > If I comment this lines out, the client reacts as desired. But: only for 
> > the chart of accounts and for most of the list-views. All forms remains 
> > read-only and are not usable.
> > 
> > Is it possible, to give me a hint, how to resolve this issue? I try to get 
> > the current view-state or make a flag, but both of them do not work as I 
> > expected this. 
> 
> I think we can not really improve those 2 lines because they are needed
> to get a correct context.
> But one thing, I already stated, is that the setter method of the
> columns [1] is called very often and this setter need to get the states
> of the field to make a proper rendering which leads to calling
> Record.expr_eval.
> Maybe [2] is a possible solution or we should cache the states on the
> cell but then the problem is invalidation of this cache (as usual).
> 
> [1]
> http://www.pygtk.org/pygtk2reference/class-gtktreeviewcolumn.html#method-gtktreeviewcolumn--set-cell-data-func
> [2] https://bugs.tryton.org/issue1318

I made a POC for issue1318: http://codereview.tryton.org/12291003/
As far as I see it gives a good improvement and doesn't seem to affect
the behavior. It is based on the idea that the content of the cell
should be recomputed only when a display is called.


-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpb3FfAodJnm.pgp
Description: PGP signature

Reply via email to