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://rawgit.com/dcodeIO/ByteBuffer.js/master/dist/ByteBufferAB.min.js"></script>
<script src="http://rawgit.com/dcodeIO/ProtoBuf.js/master/dist/ProtoBuf.min.js"></script>
var testStr = (new Array(5000)).join('{"question":"What is the answer to life and everything?", "answer": 23},');
var testData = JSON.parse("[" + testStr.substr(0, testStr.length - 1) + "]");
var builder = dcodeIO.ProtoBuf.newBuilder();
builder.create({
"name": "Msg",
"fields": [{
"rule": "required",
"options": {},
"type": "string",
"name": "question",
"id": 1
}, {
"rule": "required",
"options": {},
"type": "int32",
"name": "answer",
"id": 2
}, ]
});
var MsgBuilder = builder.build('Msg'),
protoMsg = new MsgBuilder(testData).encode().toArrayBuffer(),
jsonMsg = JSON.stringify(testData);
Ready to run.
Test | Ops/sec | |
---|---|---|
JSON encode |
| ready |
Protobuf encode |
| ready |
JSON decode |
| ready |
Protobuf decode |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.