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/bytebuffer.min.js"></script>
<script src="http://rawgit.com/dcodeIO/protobuf.js/master/dist/protobuf.min.js"></script>
var testData = {
question: 'What is the answer to life and everything?',
answer: 23
};
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.