Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

50x performance increase for invariant.getCoords() #1199

Merged
merged 2 commits into from
Dec 24, 2017

Conversation

DenisCarriere
Copy link
Member

@DenisCarriere DenisCarriere commented Dec 24, 2017

50x performance increase to invariant.getCoords()

Ref: #914 (comment)

Using the same performance approach as invariant.getCoord (PR #1197).

  • Dropped containNumbers() validation (this method can be executed separately)
  • Improved Typescript definition to output the exact numbered Array Type based on the GeoJSON Geometry Type.
  • No significant changes to the test cases.

Benchmark Results

getCoords.linestring x 61,998,817 ops/sec ±2.05% (83 runs sampled)
getCoords.polygon x 65,227,674 ops/sec ±1.30% (86 runs sampled)

Benchmark Results (Before)

getCoords.linestring x 1,407,538 ops/sec ±0.90% (90 runs sampled)
getCoords.polygon x 1,270,899 ops/sec ±2.46% (84 runs sampled)

CC: @strech345 @rowanwins @stebogit

@DenisCarriere DenisCarriere merged commit 121ba73 into master Dec 24, 2017
@rowanwins
Copy link
Member

Boom!

@muziejus
Copy link
Collaborator

🔥

@DenisCarriere DenisCarriere deleted the invariant-getCoord-performance branch December 24, 2017 20:54
@strech345
Copy link

Cool
nice christmas gift;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants