[FIX] mail: fix perf of models by removing useless onChange
onChange on each field is extremely costly, and it's not actually used unless the field is computed or sorted. Time of test "Load 100 recipients at once" is divied by more than 2. Part-of: odoo/odoo#145442
This commit is contained in:
@@ -238,7 +238,9 @@ export function makeStore(env) {
|
||||
this[name] = defaultVal;
|
||||
}
|
||||
const rfield = toRaw(field);
|
||||
onChange(proxy, name, () => (rfield.changed = true));
|
||||
if (compute || sort) {
|
||||
onChange(proxy, name, () => (rfield.changed = true));
|
||||
}
|
||||
if (compute) {
|
||||
const proxy2 = reactive(proxy, () => rfield.requestCompute());
|
||||
Object.assign(rfield, {
|
||||
|
||||
Reference in New Issue
Block a user