Describe the bug
updating store ~4000 times, 2 keys at a time
takes ~3s to complete
import { createStore, flush } from "solid-js"
const COUNT = 4000
const [store, setStore] = createStore({})
const start = performance.now()
for (
let i = 1; i < COUNT; i++
) {
setStore(store => {
store[i - 1] = false
store[i] = true
})
flush()
}
console.log(
(performance.now() - start).toFixed(3),
"ms"
)
hot path
similar code in solid 1.x takes few ms for 100,000 updates
https://s.olid.uk/id/EGa-sTlDQuyeVbKU8nv3Sw
import { render } from 'solid-js/web';
import { createSignal, createEffect } from 'solid-js';
import { produce, createStore } from "solid-js/store"
const COUNT = 100000
const [store, setStore] = createStore({})
const start = performance.now()
for (
let i = 1; i < COUNT; i++
) {
queueMicrotask(() => {
setStore(
produce(store => {
store[i - 1] = false
store[i] = true
})
);
})
}
console.log((performance.now() - start).toFixed(3) , "ms")
Your Example Website or App
https://s.olid.uk/id/r3tCfj0USguLi24fIhUXbg
Steps to Reproduce the Bug or Issue
see repro
Expected behavior
speed
Screenshots or Videos
No response
Platform
.
Additional context
No response
Describe the bug
updating store ~4000 times, 2 keys at a time
takes ~3s to complete
hot path
similar code in solid 1.x takes few ms for 100,000 updates
https://s.olid.uk/id/EGa-sTlDQuyeVbKU8nv3Sw
Your Example Website or App
https://s.olid.uk/id/r3tCfj0USguLi24fIhUXbg
Steps to Reproduce the Bug or Issue
see repro
Expected behavior
speed
Screenshots or Videos
No response
Platform
.
Additional context
No response