blocksuite
blocksuite copied to clipboard
snapshotToDoc very slow with large snapshot
The performance is slower due to the use of nextTick in the _snapshotToBlock method. Specifically, I see the following code:
await new Promise(resolve => nextTick(() => resolve(undefined)));
While nextTick is useful for handling large content during pasting, it can slow down operations when used in snapshotToDoc. It would be beneficial to add a parameter like usingNextTick to snapshotToDoc or explore other approaches to mitigate this issue.