JSthisagainstthat

JavaScript performance comparison

Test case created

Preparation code

<div>١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴ <br>٥٦٧٨٩<br>١٢٣٤٥٦٧٨٩</div>
<div> This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an١٢٣٤٥٦٧٨٩١٢٣٤  element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all١٢٣٤٥٦٧٨٩١٢٣٤  inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element!</div>

Preparation code output

١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩١٢٣٤ This is all inside an element! ۱۱۳۴
٥٦٧٨٩
١٢٣٤٥٦٧٨٩
This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an١٢٣٤٥٦٧٨٩١٢٣٤ element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all١٢٣٤٥٦٧٨٩١٢٣٤ inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element! This is all inside an element!

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
code 1
var regex = /[\u0660-\u0669]/;

function replaceText(el) {
    String.prototype.reverse = function () {
        return this.split("").reverse().join("")
    }
    if (el.nodeType === 3) {
        if (regex.test(el.data)) {
            var temp_div = document.createElement('div');
            temp_div.innerHTML = el.data.replace(/[\u0660-\u0669]{5,}/, function (s) {
                return s.
                reverse().
                replace(/(..)(.)/g, "$1aaa$2zzz").
                reverse().
                replace(/zzz(.)aaa/g, "<span style=\"color:red;\">$1</span>")
            });
            var nodes = temp_div.childNodes;
            while (nodes[0]) {
                el.parentNode.insertBefore(nodes[0], el);
            }
            el.parentNode.removeChild(el);
        }
    } else if (el.nodeType === 1) {
        for (var i = 0; i < el.childNodes.length; i++) {
            replaceText(el.childNodes[i]);
        }
    }
}

replaceText(document.body);
pending…
code 2
var regex = /[\u0660-\u0669](?=[\u0660-\u0669][\u0660-\u0669]([\u0660-\u0669]{3})*(?:[^\u0660-\u0669]|$))/,
    replacement = '<span class="mygin" style="color:red;">$&</span>';

function replaceText(el) {
    if (el.nodeType === 3) {
        if (regex.test(el.data)) {
           
            if (typeof el.data === "string") {
                var dataParts = el.data.split(" ");
                for (var i = 0; i < dataParts.length; i++) {
                    if (dataParts[i].length > 4) {
                        dataParts[i] = dataParts[i].replace(regex, replacement);
                    }
                }
                el.data = dataParts.join(" ");
            }
           
            var temp_div = document.createElement('div');
            temp_div.innerHTML = el.data;
            var nodes = temp_div.childNodes;
            while (nodes[0]) {
                el.parentNode.insertBefore(nodes[0],el);
            }
            el.parentNode.removeChild(el);
        }
    } else if (el.nodeType === 1) {
        for (var i = 0; i < el.childNodes.length; i++) {
            replaceText(el.childNodes[i]);
        }
    }
}

replaceText(document.body);
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment