scrollquest,
<script>
var d = performance.now();
for (var i=0; i<1000; i++) {document.write("scrollquest".replace(/.*/,"$& конь в вакууме " ))}
alert(performance.now()-d);
d = performance.now();
for (var i=0; i<1000; i++) {document.body.appendChild(document.createTextNode("scrollquest конь в вакууме "))}
alert(performance.now()-d);
</script>