Skip to content

Latest commit

 

History

History
117 lines (86 loc) · 4.6 KB

README.md

File metadata and controls

117 lines (86 loc) · 4.6 KB

Benchmarks

Here we compare relative speed for encoding and decoding various types of data in various libraries. For details about the data tested and the methods of benchmarking, please see this repository.

  • All tests run on:
    • MacBook Pro (15-inch, 2017)
    • macOS High Sierra (10.13.6)
    • 2.9 GHz Intel Core i7
    • 16 GB 2133 MHz LPDDR3
  • Relative results can vary wildly, for various reasons, in different environments and for different types of data.
  • Some libraries tested did not include a decode/parse option, but only sought to create JSON-compatible text in a different or more stable way.
  • One library (xson) errored out when decoding some data.
  • The native JSON implementation seems to be consistently very fast, though typically the most limited.
  • json-complete, while typically towards the bottom of ops/second among these libraries, is never the slowest library except in one case (Node, encoding single value data).
    • This isn't unexpected, as it probably has the most features and has not been optimized for performance.

Links to all tested libraries below.

Node (11.4.0) - Data

encode singleValue

Node - encode - singleValue

decode singleValue

Node - decode - singleValue

encode smallData

Node - encode - smallData

decode smallData

Node - decode - smallData

decode largeData

Node - decode - largeData

encode largeData

Node - encode - largeData

Google Chrome (76) - Data

encode singleValue

Chrome - encode - singleValue

decode singleValue

Chrome - decode - singleValue

encode smallData

Chrome - encode - smallData

decode smallData

Chrome - decode - smallData

decode largeData

Chrome - decode - largeData

encode largeData

Chrome - encode - largeData

Firefox (68) - Data

encode singleValue

Firefox - encode - singleValue

decode singleValue

Firefox - decode - singleValue

encode smallData

Firefox - encode - smallData

decode smallData

Firefox - decode - smallData

decode largeData

Firefox - decode - largeData

encode largeData

Firefox - encode - largeData

Library Links