mt-polygon-simplification/lib/simplify-js/bench/bench.js
2019-07-14 20:37:26 +02:00

20 lines
441 B
JavaScript

var Benchmark = require('benchmark');
var simplify = require('../simplify');
var points = require('../test/fixtures/1k.json');
console.log('Benchmarking simplify on ' + points.length + ' points...');
new Benchmark.Suite()
.add('simplify (HQ)', function() {
simplify(points, 1, true);
})
.add('simplify', function() {
simplify(points, 1, false);
})
.on('cycle', function(event) {
console.log(String(event.target));
})
.run();