-
Notifications
You must be signed in to change notification settings - Fork 3
/
bench.js
43 lines (41 loc) · 1.2 KB
/
bench.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
global.extent = require('./');
global.extent2 = require('./index-lazy-reduce');
var Benchmark = require('benchmark');
var fs = require('fs');
global.fc = require('./geojson/FeatureCollection');
global.pt = require('./geojson/Point');
global.line = require('./geojson/LineString');
global.poly = require('./geojson/Polygon');
global.multiLine = require('./geojson/MultiLineString');
global.multiPoly = require('./geojson/MultiPolygon');
var suite = new Benchmark.Suite('turf-extent');
suite
.add('turf-extent#FeatureCollection',function () {
global.extent(global.fc);
})
.add('turf-extent2#FeatureCollection',function () {
global.extent2(global.fc);
})
/*
.add('turf-extent#Point',function () {
global.extent(global.pt);
})
.add('turf-extent#LineString',function () {
global.extent(global.line);
})
.add('turf-extent#Polygon',function () {
global.extent(global.poly);
})
.add('turf-extent#MultiLineString',function () {
global.extent(global.multiLine);
})
.add('turf-extent#MultiPolygon',function () {
global.extent(global.multiPoly);
})
*/
.on('cycle', function (event) {
console.log(String(event.target));
})
.on('complete', function () {
})
.run();