jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
This is a test to find out how fast List.js (www.listjs.com) searches through a list with 1000 items.
Specification (or read the code) 1 table 4 columns for each row
<div class="example c1">
<h2>Contact list</h2>
<div id="contacts" style="height:200px; overflow:scroll;">
<table>
<thead>
<tr>
<th class="sort" rel="name">Name</th>
<th class="sort" rel="age">Age</th>
<th class="sort" rel="city">City</th>
<th colspan="2">
<input type="text" class="search" placeholder="Search contact" />
</th>
</tr>
</thead>
</table>
<div class="huge">
<table>
<tbody class="list">
<tr><td class="id" style="display:none;"></td><td class="name"></td><td class="age"></td><td class="city"></td></tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="//listjs.com/js/list.js"></script>
function randomString(length) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
if (! length) {
length = Math.floor(Math.random() * chars.length);
}
var str = '';
for (var i = 0; i < length; i++) {
str += chars[Math.floor(Math.random() * chars.length)];
}
return str;
}
var contacts = [];
// Init list
for (var i = 0; i < 1000; i++) {
contacts.push({
id: Math.floor(Math.random()*1100000),
name: randomString(13),
age: Math.floor(Math.random()*110),
city: randomString(13)
});
}
// Define value names
var templates = {
valueNames: [ 'id', 'name', 'age', 'city' ]
};
var contactList = new List('contacts', templates, contacts);
Ready to run.
Test | Ops/sec | |
---|---|---|
Search string |
| ready |
Search number |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.