4 ms·
I worked on improving the performance of an extension that had to parse the DOM and any mutations. Performance was horrible in Firefox, not nearly as bad in Ch
by franklyt 6y ago
I worked on improving the performance of an extension that had to parse the DOM and any mutations.
Performance was horrible in Firefox, not nearly as bad in Chromium browsers but improvements could be found.
What worked: parsing the DOM with a tree-walker (instantly rejecting nodes that didn’t need to be checked, like style tags) and throttling checks with a mutation observer, i.e. mutations would be collected and parsed together after a timeout interval. Wasn’t too difficult, I think that some of these things can be overlooked because front-end engineers typically don’t concern themselves with performance.