Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yepitschunked/e33c9cb1fe9587236eb1ec11afd43772 to your computer and use it in GitHub Desktop.
Save yepitschunked/e33c9cb1fe9587236eb1ec11afd43772 to your computer and use it in GitHub Desktop.
var resolve = require('../resolve');
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
suite.add('uncached', () => {
delete process.env.CACHE;
resolve.sync('./frontend/homes-pdp-marketplace/components/Policies.jsx');
});
suite.add('cached', () => {
process.env.CACHE = true;
resolve.sync('./frontend/homes-pdp-marketplace/components/Policies.jsx');
});
suite.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment