Sébastien Theys 78bef3e08c [FIX] mail: improve performance of JS write, especially for x2m
- store `x2many` values as `Set`. This is conceptually more correct because
  duplicates were already not allowed, and using a `Set` allows for much faster
  operations such as checking the presence of a record in the relation, which is
  done at every write, for every linked record.

- `stringify` in `write` was slow and unnecessary because we can always assume
  that new non-primitive should be provided to `write`

- remove field values from store, in favor of just storing a counter, which is
  enough to trigger renders. This allows to get rid of one Proxy level around
  data, which was slower, but which also prevented from using `Set`.

- write in store exactly once per update cycle, to trigger one `useStore` call
  on each component. Records keep `__state` but as a local counter, to let
  `useStore` know which records have been updated (easier to compare a counter
  than comparing each and every field value).

Results
=======

The worse case test (using a lot of x2m) that was used to benchmark this PR
`form_renderer_tests.js` of `mail_enterprise` went from taking around 4s before
this commit, to around 2.5s after this commit.
And the worse `_setRelationLinkMany2Many` previously took around 250ms, and it
now takes around 50ms.

The whole `mail` QUnit suite took around 55s before, now around 42s.

Part of task-2308312

closes odoo/odoo#55248

X-original-commit: 4db0a10d85534ef896f6bcbf13bca4983a6e2003
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-31 09:43:01 +00:00
2020-04-20 11:41:39 +00:00
2015-09-08 15:45:09 +02:00
2019-10-03 12:48:09 +00:00
…
2015-09-08 17:58:38 +02:00
2019-11-08 11:24:04 +00:00
2019-10-03 12:48:09 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%