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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://github.com/downloads/SteveSanderson/knockout/jquery.tmpl.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script>
<div id="koTest">
<ul data-bind="template: { name: 'item_koTmpl', foreach: items }"></ul>
</div>
<div id="jqTest"
<ul data-bind="template:{ name : 'item_jqTmpl', foreach : items}"></ul>
</div>
<script id="item_koTmpl" type="text/x-jquery-tmpl">
<li data-bind="text: id"></li>
<li data-bind="text: name"></li>
<li data-bind="text: type"></li>
</script>
<script id="item_jqTmpl" type="text/x-jquery-tmpl">
<li data-bind="text: id"></li>
<li data-bind="text: name"></li>
<li data-bind="text: type"></li>
</script>
<script>
$(function(){
function Item(id, name, type) {
return {
id: ko.observable(id),
name: ko.observable(name),
type: ko.observable(type)
}
}
window.viewModel = {
items: ko.observableArray([new Item(1, "one", "a"), new Item(2, "two", "b"), new Item(3, "three", "a")])
};
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
KO native templating NOT bound to a DOM element |
| ready |
KO native templating bound to a DOM element |
| ready |
jquery templating NOT bound to DOM element |
| ready |
jquery templating bound to DOM element |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.