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

[TESTING] 4x faster polygon decoding #93

Merged
merged 1 commit into from
Jan 25, 2019
Merged

Conversation

springmeyer
Copy link
Contributor

@springmeyer springmeyer commented Dec 8, 2018

This speeds up polygon decoding + clipping + encoding by 4x. Polygons are going to be the slowest to overzoom, so this is significant.

The speed boost comes from avoiding the allocation of intermediate vectors to store rings. Instead we collect bbox's while we decode, only clip geometries that are not fully within the target tile, and when we have results we encode them directly to the new feature.

Current master, for test 11 gives:

node bench/bench.js --iterations 500 --concurrency 1 --package vtcomposite
11: tiles completely made of polygons, overzooming and lots of properties ... 166 runs/s (3015ms)

This PR gives, for test 11, gives:

node bench/bench.js --iterations 500 --concurrency 1 --package vtcomposite
11: tiles completely made of polygons, overzooming and lots of properties ... 728 runs/s (687ms)

Next steps:

  • Review from @ericfischer
  • Review from @flippmoke
  • Dev package + test in staging
  • determine it is ready to merge + officially release

/cc @mapbox/maps-api @artemp @flippmoke @ericfischer @millzpaugh

@artemp artemp merged commit 0b83951 into master Jan 25, 2019
@mapsam mapsam deleted the speed-up-poly-decode-redux branch February 27, 2019 18:26
@mapsam mapsam restored the speed-up-poly-decode-redux branch February 27, 2019 18:26
@artemp
Copy link
Contributor

artemp commented Mar 5, 2019

The bench results here are bogus and 4x speed-ups are due to the bug #95.

With #95 fixed I'm getting roughly equivalent results:

Current master

11: tiles completely made of polygons, overzooming and lots of properties ... 252 runs/s (1984ms)

This PR

11: tiles completely made of polygons, overzooming and lots of properties ... 251 runs/s (1992ms)

/cc @mapsam @flippmoke @ian29

@mapsam mapsam mentioned this pull request Aug 14, 2019
@springmeyer springmeyer deleted the speed-up-poly-decode-redux branch April 7, 2020 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants