Sha256: 4c57b725091bbc8ad7c85a57f9a529128c2144eba897ac5307269cbaf642ac21

Contents?: true

Size: 556 Bytes

Versions: 58

Compression:

Stored size: 556 Bytes

Contents

var fs = require('fs'),
    Parser = require('./jsonparse');


var json = fs.readFileSync("samplejson/basic.json");


while (true) {
  var start = Date.now();
  for (var i = 0; i < 1000; i++) {
    JSON.parse(json);
  }
  var first = Date.now() - start;

  start = Date.now();
  var p = new Parser();
  for (var i = 0; i < 1000; i++) {
    p.write(json);
  }
  var second = Date.now() - start;


  console.log("JSON.parse took %s", first);
  console.log("streaming parser took %s", second);
  console.log("streaming is %s times slower", second / first);
}

Version data entries

58 entries across 49 versions & 7 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.59 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.58 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.57 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.56 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.55 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.54 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.53 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.52 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.51 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.50 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.49 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.48 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.47 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.46 node_modules/jsonparse/bench.js
pcp-server-ruby-sdk-0.0.6 node_modules/jsonparse/bench.js
pcp-server-ruby-sdk-0.1.0 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.45 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.44 node_modules/jsonparse/bench.js
immosquare-cleaner-0.1.43 node_modules/jsonparse/bench.js