rrweb-io / rrweb

record and replay the web
https://www.rrweb.io/
MIT License
16.8k stars 1.43k forks source link

Page get stuck while manipulate milion's of nodes #668

Open PeterChen1997 opened 3 years ago

PeterChen1997 commented 3 years ago

Our page has a lot of nodes, if we open rrweb while spa page jumping, the page will get stuck for 1-3s than not open it. Here is the performance while spa page jumping

open: (Mango is the sdk that we seal rrweb in)

image

close:

image

Is there any config that i can speed up this action?

Yuyz0112 commented 3 years ago

Is it possible to provide the record page URL or similar example page for performance testing?

PeterChen1997 commented 3 years ago

Is it possible to provide the record page URL or similar example page for performance testing?

the env is so complicated.. i think it's hard to replay this 1:1

I think it's the node manipulation cause this problem, it's fine when node is smaller than 400W ...

Yuyz0112 commented 3 years ago

@PeterChen1997 Maybe you can dump the dev tool's profile.json so we can check which code path takes most of the time.

PeterChen1997 commented 3 years ago

@PeterChen1997 Maybe you can dump the dev tool's profile.json so we can check which code path takes most of the time.

can i send the json in wechat? Here is my number: xxx

Yuyz0112 commented 3 years ago

@PeterChen1997 send a request to you. You can delete the number now:)

Yuyz0112 commented 3 years ago

After some debug, most of the time was used to iterating DOM nodes and node's classList.

PeterChen1997 commented 3 years ago

After some debug, most of the time was used to iterating DOM nodes and node's classList.

Got it, is it the bottleneck of our algorithm? I found when my computer cpu is free, everything will be all right...