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
Performance comparison between the knockout mapping plugins ko.viewmodel and ko.mapping.
<script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.0/knockout-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/knockout.mapping/2.3.3/knockout.mapping.js"></script>
<script src="http://coderenaissance.github.com/knockout.viewmodel/knockout.viewmodel.min.js"></script>
var numberOfArrayRecords = 100,
viewmodel = null,
model = {
items:[]
};
model2 = {
items:[]
};
for(var x = 0; x < numberOfArrayRecords; x++){
model.items.push({
string:"Test",
number:4,
anotherObject:{
items:[{id:4, name:"Test"},{id:7, name:"Test2"}]
}
});
}
for(var x = 0; x < numberOfArrayRecords; x++){
model2.items.push({
string: ko.observable("Test"),
number: ko.observable(4),
anotherObject: ko.observable({
items:ko.observableArray([{id:ko.observable(4), name:ko.observable("Test")},{id:ko.observable(7), name: ko.observable("Test2")}])
})
});
}
Ready to run.
Test | Ops/sec | |
---|---|---|
ko.mapping |
| ready |
ko.viewmodel |
| ready |
manual.mapping |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.