For example in the below timeline, I'm scrolling up and down between 3s mark and 7s mark. The scrolling does not appear to be smooth. The closeup is the first and largest block of scripting (200ms). My understanding is that the browser cannot both do main-thread JS and paint at the same time. Is that correct? If yes, then if that block of script is removed, then the green painting section that follows can be performed sooner, thereby resulting in smoother scrolling?
Closeup:
Yes and yes. Move long-running JS to a worker.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.