HTML Preparation code:
AخA
 
1
<script src="https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js"></script>
Script Preparation code:
 
var stringData = {"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML","SortAs":"SGML","GlossTerm":"Standard Generalized Markup Language","Acronym":"SGML","Abbrev":"ISO 8879:1986","GlossDef":{"para":"A meta-markup language, used to create markup languages such as DocBook.","GlossSeeAlso":["GML","XML"]},"GlossSee":"markup"}}}}};
var numberData = [
  [1, 2, 3, 4, -1, true, null],
  [3, 6, 5, 4,  1, false, 7],
  [3, 2, 8, 1,  0, true, 0],
  [10, 11, 12, 13,  14, false, true],
  [15, 16, 17, 18, 19, true, null],
  [20, 21, 22, 23,  24, false, 7],
  [25, 26, 27, 28,  29, true, 0],
  100, 200, 300,
  [
    [1, 0, 0, 0, 0],
    [0, 1, 0, 0, 0],
    [0, 0, 1, 0, 0],
    [0, 0, 0, 1, 0],
    [0, 0, 0, 0, 1]
  ]
];
var jsonEncodedStrings = JSON.stringify(stringData),
    jsonEncodedNumbers = JSON.stringify(numberData),
    msgpackEncodedStrings = msgpack.encode(stringData),
    msgpackEncodedNumbers = msgpack.encode(numberData);
Tests:
  • MsgPack Strings Encode

     
    var result = msgpack.encode(stringData);
  • JSON Strings Encode

     
    var result = JSON.stringify(stringData);
  • MsgPack Numbers Encode

     
    var result = msgpack.encode(numberData);
  • JSON Numbers Encode

     
    var result = JSON.stringify(numberData);
  • JSON string decode

     
    var result = JSON.parse(jsonEncodedStrings);
  • msgpack string decode

     
    var result = msgpack.decode(msgpackEncodedStrings);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    MsgPack Strings Encode
    JSON Strings Encode
    MsgPack Numbers Encode
    JSON Numbers Encode
    JSON string decode
    msgpack string decode

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 14 days ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133 on Linux
View result in a separate tab
Test name Executions per second
MsgPack Strings Encode 150755.3 Ops/sec
JSON Strings Encode 754351.1 Ops/sec
MsgPack Numbers Encode 114292.2 Ops/sec
JSON Numbers Encode 508692.3 Ops/sec
JSON string decode 402974.7 Ops/sec
msgpack string decode 128990.5 Ops/sec