fix: remove terraformer-wkt-parser dependency - #9545
Merged
Conversation
Contributor
Author
|
Opposite of #5682, ironically now var Benchmark = require('test.benchmark')
global.wkx = require('wkx')
global.wkt = require('terraformer-wkt-parser')
global.polygon = { "type": "Polygon", "coordinates": [ [ [ 8.26171875, 49.03786794532644 ], [ 11.77734375, 33.87041555094183 ], [ 39.55078125, 50.401515322782366 ], [ 27.421875, 61.270232790000634 ], [ 10.1953125, 62.99515845212052 ], [ -9.667968749999998, 51.28940590271679 ], [ -7.3828125, 32.99023555965106 ], [ -36.73828124999999, 11.350796722383684 ], [ -11.42578125, -44.46515101351962 ], [ 25.6640625, -12.897489183755892 ], [ 23.73046875, 13.581920900545844 ], [ 31.113281249999996, 23.725011735951796 ], [ 8.26171875, 49.03786794532644 ] ] ] }
global.linestring = { "type": "LineString", "coordinates": [ [ -16.171875, 71.07405646336098 ], [ 49.04296875, 69.28725695167886 ], [ 46.58203125, 40.84706035607122 ], [ 29.70703125, -8.407168163601076 ], [ -13.886718749999998, -28.14950321154457 ], [ -108.10546875, 34.30714385628804 ], [ -81.73828125, 56.65622649350222 ], [ -88.24218749999999, 36.4566360115962 ], [ -94.21875, -7.01366792756663 ], [ -92.46093749999999, -6.315298538330021 ], [ -91.40625, -4.214943141390639 ], [ -89.6484375, -5.090944175033373 ], [ -88.76953125, -8.407168163601076 ], [ -81.03515625, -7.536764322084078 ], [ -48.8671875, 57.98480801923985 ], [ -40.78125, 47.39834920035926 ], [ -54.84375, 22.43134015636061 ], [ -57.30468749999999, -17.14079039331665 ], [ -47.63671875, -33.43144133557529 ], [ -36.9140625, -7.01366792756663 ] ] }
global.points = [ { "type": "Point", "coordinates": [ 16.69921875, 68.59248658252947 ] }, { "type": "Point", "coordinates": [ 54.4921875, 36.73888412439431 ] }, { "type": "Point", "coordinates": [ 8.7890625, 16.29905101458183 ] }, { "type": "Point", "coordinates": [ -6.85546875, 38.685509760012 ] }, { "type": "Point", "coordinates": [ 16.5234375, 58.63121664342478 ] }, { "type": "Point", "coordinates": [ -2.4609375, 59.88893689676585 ] }, { "type": "Point", "coordinates": [ -53.96484375, 70.25945200030638 ] }, { "type": "Point", "coordinates": [ -98.4375, 58.17070248348612 ] }, { "type": "Point", "coordinates": [ -104.94140625, 31.653381399664 ] }, { "type": "Point", "coordinates": [ -94.74609375, 39.774769485295465 ] }, { "type": "Point", "coordinates": [ -35.5078125, 40.3130432088809 ] }, { "type": "Point", "coordinates": [ -103.18359375, -34.161818161230386 ] }, { "type": "Point", "coordinates": [ -48.515625, -24.04646399966658 ] }, { "type": "Point", "coordinates": [ -61.34765625, -9.10209673872643 ] } ]
Benchmark.runWithDefaults([
Benchmark.syncSuite('polygon', {
wkx: function() {
wkx.Geometry.parseGeoJSON(polygon).toWkt()
},
terraformer: function() {
wkt.convert(polygon)
}
}),
Benchmark.syncSuite('linestring', {
wkx: function() {
wkx.Geometry.parseGeoJSON(linestring).toWkt()
},
terraformer: function() {
wkt.convert(linestring)
}
}),
Benchmark.syncSuite('points', {
wkx: function() {
points.forEach(function (x) { wkx.Geometry.parseGeoJSON(x).toWkt() })
},
terraformer: function() {
points.forEach(function (x) { wkt.convert(x) })
}
})
])Benchmarks for: polygon...
o wkx x 418,250 ops/sec ±2.15% (135 runs sampled)
o terraformer x 166,498 ops/sec ±2.64% (127 runs sampled)
Fastest: wkx
Slowest: terraformer
---
Benchmarks for: linestring...
o wkx x 228,168 ops/sec ±2.49% (130 runs sampled)
o terraformer x 119,201 ops/sec ±2.00% (134 runs sampled)
Fastest: wkx
Slowest: terraformer
---
Benchmarks for: points...
o wkx x 487,693 ops/sec ±2.24% (130 runs sampled)
o terraformer x 167,483 ops/sec ±1.47% (137 runs sampled)
Fastest: wkx
Slowest: terraformer
---
All benchmarks finished. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change