summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-05-05 06:50:59 +0200
committerGéry Debongnie <ged@odoo.com>2017-05-07 22:38:27 +0200
commitc75680c527844b3b984fa6dfbe04b612528cd9fb (patch)
tree657c8ccbd11bf5f632c44a2e79da3379f13e5b30 /addons/web/static/src/js/views/basic/basic_renderer.js
parent9d7b421b8c2f35ed61d21fad87291b1760bb7ded (diff)
[REF] web: optimize basic model (improve perfs for most views)
The 'get' method in the basic model is called very often (too often, but that is another issue). For a large list with many columns, it can be quickly be called more than 10k times. In that function, we had to protect our integrity by performing a deep clone with $.extend, so noone else can be allowed to change something in our internal structure. This is good in theory, but not so good in practice, as $.extend is a really expensive operation. Also, we try to have the smallest external API by deleting useless keys. But instead of keeping a blacklist of private keys, it is simpler to have a whitelist of public keys. So, what we do is to explicitely construct the object returned by key, since we know the types of every values involved. This is more explicit, and at the same time, much faster. Also, we propagate the options for elements of type list. This is why I had to change the isFieldSet method. In a benchmark I just ran, loading and rendering a large list (200 rows, 7 columns) went from about 2.7s to 0.7s. We still do way too much work, but at least it is much faster...
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
0 files changed, 0 insertions, 0 deletions