Skip to content Skip to sidebar Skip to footer

Methods To Reduce Apparent Lag To Client From Large Javascript Operations

As part of my Chrome Extension, I am performing a few regex replaces on a lot of (upwards of 3000) elements on the document end event. In the worst cases, in Chrome 34.0.1847.116 m

Solution 1:

You can run the long operations in a new thread using the setTimeout function and a callback on completion.

See Javascript Create New "Thread"

Post a Comment for "Methods To Reduce Apparent Lag To Client From Large Javascript Operations"