Message 71571

Author
ced
Date
2021-11-09.11:52:38
Message id
71571

Content

I think we must remove the feature in 6.2 series as it can not work by design and re-implementing it will need to change the API (see the following proposal).

So in order to keep the performance improvement I see two possibilities (which can both be implemented) which restore partially the initial goal:

  • add an attribute on Function field which define if the getter function depends on the context or not. If it does not depend we can store the result in the global cache in readonly transaction. (I could not find any other method than a flag, I tried to detect usage of context but there are two much side-effect). Also in this case the Function field must reset the context (with only the cache keys of transaction) to ensure that the result is independent of it (and to detect wrong configuration).
  • we fill the local cache of the instance in Function.get with the values already read. This can only be done for base python type like numeric or string but not with instances. This can be done also on non-readonly transaction but it will improve the performance only for the current instances (not if the value is reused by an indirect instance).
History
Date User Action Args
2021-11-09 11:52:38cedsetmessageid: <1636455158.5757751.I4VTUB3OFQLFR4RC.issue10936@tryton.org>
2021-11-09 11:52:38cedsetrecipients: + nicoe, edbo
2021-11-09 11:52:38cedlinkissue10936 messages
2021-11-09 11:52:38cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)