Sha256: e489d3f6b6763efa3836e66b798d26a004d6682cc902269033653d6ade635f82

Contents?: true

Size: 660 Bytes

Versions: 5

Compression:

Stored size: 660 Bytes

Contents

'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');

var bench = common.createBenchmark(main, {
  path: [
    '',
    '.',
    '/../',
    '/foo',
    '/foo/bar',
    '/foo/bar//baz/asdf/quux/..'
  ],
  n: [1e6]
});

function main(conf) {
  var n = +conf.n;
  var p = path.posix;
  var input = '' + conf.path;

  // Force optimization before starting the benchmark
  p.normalize(input);
  v8.setFlagsFromString('--allow_natives_syntax');
  eval('%OptimizeFunctionOnNextCall(p.normalize)');
  p.normalize(input);

  bench.start();
  for (var i = 0; i < n; i++) {
    p.normalize(input);
  }
  bench.end(n);
}

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/benchmark/path/normalize-posix.js
node-compiler-0.9.0 vendor/node-v7.2.1/benchmark/path/normalize-posix.js
node-compiler-0.8.0 vendor/node-v7.2.0/benchmark/path/normalize-posix.js
node-compiler-0.7.0 vendor/node-v6.9.1/benchmark/path/normalize-posix.js
node-compiler-0.7.0 vendor/node-v7.1.0/benchmark/path/normalize-posix.js