Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Javascript v Jquery for BR
(version: 0)
BR speed test for rudimentary versions
Comparing performance of:
Jquery vs Javascrippt
Created:
3 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <p class="bioRead">Hello world. </p> <p class="bioRead">This is 1 attempt to add Biotic Reading Functionality - bootleg edition.</p>
Tests:
Jquery
$('p').each(function(){ //split by word var pdata = $(this); var words = pdata.text().match(/\b(\w+)'?(\w+)?\b/g); //replace the first half of every word with bold $.each(words, function(w){ let boldword = words[w]; let half = boldword.substring(0, Math.ceil(boldword.length/2)); boldword = boldword.replace (half, '<strong>$&</strong>'); words[w] = boldword; }) //return it to the html pdata.html(words.join(" ")); });
Javascrippt
var elms = $(".bioRead"); for (var p = 0; p < elms.length; p++) { str = elms[p].innerText; var result = ""; var res = str.split(" "); for (var w = 0; w < res.length; w++) { let word = res[w]; if (word.length > 1) { let half = word.substring(0, Math.ceil(word.length / 2)); word = word.replace(half, '<strong>$&</strong>'); } result += (word + " ") } elms[p].innerHTML = result; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Jquery
Javascrippt
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
reparsing jQuery speed test
jQuery vs Vanilla JS Speed Test - CNC
JQUERY VS VANILLA v-na0
JQUERY VS VANILLA v-na1
JQUERY VS VANILLA v-na2
Comments
Confirm delete:
Do you really want to delete benchmark?