diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-05-03 22:45:30 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-05-04 13:45:26 +0200 |
| commit | 0d5d9fa3f54519939cd31ff5121de341204b3a3c (patch) | |
| tree | b5af1187658e83a4d1963b60c732d6d9729fb25c /addons/web/static/src/js/views/basic/basic_renderer.js | |
| parent | 7d26d244a438a71d633922e043b18e488dbe269b (diff) | |
[FIX] web: improve editable list view rendering speed
The editable list view may be really new, but it still suffers from a
performance issue. The problem is that we need to evaluate modifiers
for a (sometimes) large number of fields: a list view with 80 rows and 7
columns has 560 field values. This is not so large, but each of these
evaluation is still costly.
In particular, it needs to compute the evaluation context. However, the
evaluation context is the same between all fields of the same record, so
in that case, the web framework does way too much work (with 7 columns,
it is 7 times too much).
This commit does not totally fix the issue, but it helps quite a lot.
What we do is just memoize the evalcontext computation. This means that
it will be evaluated only the first time it is needed, then will be kept
in memory.
Note that this is a fix, not an imp. The list view should be fast...
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_renderer.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 25ba02530be..3f0c67c7e70 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -282,7 +282,7 @@ var BasicRenderer = AbstractRenderer.extend({ * @param {Object} record */ _computeModifiers: function (modifiersData, record) { - var evalContext = record.getEvalContext(); + var evalContext = record.evalContext; modifiersData.evaluatedModifiers[record.id] = _.mapObject(modifiersData.modifiers, function (modifier) { return new Domain(modifier, evalContext).compute(evalContext); |
