3 ms·
For the specific case of doing a map or filter operation on a really huge list, I've found it helpful to yield the main thread every once in a while with a setT
by csande17 5y ago
For the specific case of doing a map or filter operation on a really huge list, I've found it helpful to yield the main thread every once in a while with a setTimeout(0) call. Usually this means setting your code up so it can do the processing in batches of, say, 10K items each. That way, you can do your processing without locking up other UI stuff on the page (like scrolling or animated loading spinners).