-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify, optimize. ~7.6x performance increase.
* Creates valid polygon rings the first time * Stores properties on nodes so it doesn't have to do nearest calls * Removes two dependencies turf-tin x 3,078 ops/sec ±0.73% (96 runs sampled) turf-tin 2 x 23,254 ops/sec ±0.77% (99 runs sampled)
- Loading branch information
Showing
4 changed files
with
125 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
var tin = require('./'); | ||
global.tin = require('./'); | ||
var Benchmark = require('benchmark'); | ||
var fs = require('fs'); | ||
|
||
var points = JSON.parse(fs.readFileSync(__dirname+'/geojson/Points.geojson')); | ||
global.points = JSON.parse(fs.readFileSync(__dirname+'/geojson/Points.geojson')); | ||
|
||
var suite = new Benchmark.Suite('turf-tin'); | ||
suite | ||
.add('turf-tin',function () { | ||
tin(points, 'elevation'); | ||
global.tin(global.points, 'elevation'); | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
}) | ||
.on('complete', function () { | ||
|
||
}) | ||
.run(); | ||
.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters