fix queue and use a unsafe but performant checker
This commit is contained in:
@@ -917,7 +917,7 @@ export class Replayer {
|
|||||||
next = mirror.getNode(mutation.nextId) as Node;
|
next = mirror.getNode(mutation.nextId) as Node;
|
||||||
}
|
}
|
||||||
if (nextNotInDOM(mutation)) {
|
if (nextNotInDOM(mutation)) {
|
||||||
queue.push(mutation);
|
return queue.push(mutation);
|
||||||
}
|
}
|
||||||
|
|
||||||
const target = buildNodeWithSN(
|
const target = buildNodeWithSN(
|
||||||
@@ -962,12 +962,19 @@ export class Replayer {
|
|||||||
appendNode(mutation);
|
appendNode(mutation);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let startTime = Date.now();
|
||||||
while (queue.length) {
|
while (queue.length) {
|
||||||
if (
|
/**
|
||||||
queue.every(
|
* Looks like this check is killing the performance
|
||||||
(m) => !Boolean(mirror.getNode(m.parentId)) || nextNotInDOM(m),
|
*/
|
||||||
)
|
// if (
|
||||||
) {
|
// queue.every(
|
||||||
|
// (m) => !Boolean(mirror.getNode(m.parentId)) || nextNotInDOM(m),
|
||||||
|
// )
|
||||||
|
// ) {
|
||||||
|
// return queue.forEach((m) => this.warnNodeNotFound(d, m.node.id));
|
||||||
|
// }
|
||||||
|
if (Date.now() - startTime > 5000) {
|
||||||
return queue.forEach((m) => this.warnNodeNotFound(d, m.node.id));
|
return queue.forEach((m) => this.warnNodeNotFound(d, m.node.id));
|
||||||
}
|
}
|
||||||
const mutation = queue.shift()!;
|
const mutation = queue.shift()!;
|
||||||
|
|||||||
Reference in New Issue
Block a user