summaryrefslogtreecommitdiff
path: root/addons/anonymization/ir.model.fields.anonymization.csv
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2016-06-02 21:14:50 +0200
committerOlivier Dony <odo@openerp.com>2016-06-02 21:15:21 +0200
commitaf1a8758ec303dd5b0c30b44d06eac29bfc82ec9 (patch)
treea7a44da5e20ae1a5fa8cfbff2cb3ad59bfcec57f /addons/anonymization/ir.model.fields.anonymization.csv
parentf558c049d03d822394b6edf844d8ab862cdb1115 (diff)
[FIX] res.partner: performance of name_get()
Rev. 93e9a4dce7550af5cecab398670a4a53ea41f130 tried to speed up the 9.0 name_get() of res.partner by only calling fields_get() once for the whole name_get, instead of calling it lazily. This may have worked for name_get calls on multiple unnamed addresses (name is NULL), but this is a rare occurrence in practice - while now every single name_get() call would incur the full cost of the fields_get() call. That fields_get() call is O(n) in the number of fields, and there can be quite a few for res.partner. Calling it only for the specific 'type' field can easily be about 40x faster than without it. And since name_get() is called for each Many2One field of each record being read (due to convert_to_read()), reading a batch of records with partner fields had become quite a bit slower! Avoiding this cost entirely with lazy fields_get() calls saves quite a lot of time for the common cases. And now that fields_get() specifies a single field, it is cheap enough to be called within the loop. Non-scientific benchmark: account.invoice.search_read() in the list view of invoices took 500ms for 25 invoices _before_ this fix, and 90ms after!
Diffstat (limited to 'addons/anonymization/ir.model.fields.anonymization.csv')
0 files changed, 0 insertions, 0 deletions