Skip to content

Commit

Permalink
Improve computed perf by setting currentEpoch after set (#303)
Browse files Browse the repository at this point in the history
The benchmark for `computed` on my machine increased
from 3,815 ops/sec to 5,193 ops/sec
  • Loading branch information
russelldavis committed May 8, 2024
1 parent 02fdc75 commit 41ae903
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions computed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let computedStore = (stores, cb, batched) => {
})
} else {
$computed.set(value)
currentEpoch = epoch
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"import": {
"./index.js": "{ map, computed, }"
},
"limit": "806 B"
"limit": "814 B"
}
],
"clean-publish": {
Expand Down

0 comments on commit 41ae903

Please sign in to comment.