-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
参考一下代码:
import { produce } from 'limu';
let data2 = {
history: Array.from({ length: 10 }).map(() => ({
list: Array.from({ length: 10000 }).map((_, i) => ({
id: i,
})),
})),
}
const start = Date.now();
const newData = produce(data2, draft => {
draft.history = draft.history.slice(1);
})
console.log('slice', Date.now() - start, 'ms', newData);输出:
slice 1 ms { history: [ ] }
输出保留了 proxy 状态,导致后续使用数据时出现问题。
出问题版本:
^4.1.1
在 3.13.2 版本中未出现问题,但是在 3.13.2 中对于大对象有性能问题,上述脚本耗时: 1220 ms
fantasticsoul
Metadata
Metadata
Assignees
Labels
No labels