HTML Preparation code:
AخA
 
1
<script src="https://unpkg.com/@msgpack/msgpack@2.7.2/dist.es5+umd/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 = MessagePack.encode(stringData),
    msgpackEncodedNumbers = MessagePack.encode(numberData);
Tests:
  • MsgPack Strings Encode

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

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

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

     
    var result = JSON.stringify(numberData);
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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133 on Windows
View result in a separate tab
Test name Executions per second
MsgPack Strings Encode 110338.8 Ops/sec
JSON Strings Encode 1909856.5 Ops/sec
MsgPack Numbers Encode 199329.4 Ops/sec
JSON Numbers Encode 1041953.7 Ops/sec