Skip to content

Commit ef4bc3f

Browse files
committed
Fixed regression performance drop
1 parent e953595 commit ef4bc3f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/core/computedvalue.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import {
22
IObservable,
33
reportObserved,
44
propagateMaybeChanged,
5-
propagateChangeConfirmed
5+
propagateChangeConfirmed,
6+
startBatch,
7+
endBatch
68
} from "./observable"
79
import {
810
IDerivation,
@@ -129,7 +131,9 @@ export class ComputedValue<T> implements IObservable, IComputedValue<T>, IDeriva
129131
if (globalState.inBatch === 0) {
130132
if (shouldCompute(this)) {
131133
this.warnAboutUntrackedRead()
134+
startBatch() // See perf test 'computed memoization'
132135
this.value = this.computeValue(false)
136+
endBatch()
133137
}
134138
} else {
135139
reportObserved(this)

0 commit comments

Comments
 (0)