preact-markup icon indicating copy to clipboard operation
preact-markup copied to clipboard

Avoid using .textContent

Open developit opened this issue 5 years ago • 1 comments

Text.data is faster: https://esbench.com/bench/590c9cfe99634800a0347ffc

developit avatar Aug 04 '19 21:08 developit

Indeed, .textContent is an order of magnitude slower. Apart from the code conflicts, is there anything blocking this PR? This is a pretty straight-forward and safe change, as you are checking n.nodeType === 3 (Text node, which is CharacterData and therefore has the data property).

danielweck avatar Mar 30 '21 08:03 danielweck