-
Notifications
You must be signed in to change notification settings - Fork 28
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
Make migration stream more efficient #102
Conversation
@springmeyer I'd like to bring this along with #107 for the 7.x release. Is this branch still viable? |
@mapsam - sounds good to bring this along. The branch should be correct, but I would love some second eyes to make sure it is working right: 1) that |
@mapsam - just resolved the conflict with master via the github UI - hopefully should be good to review now. |
Thanks @springmeyer! I'll work on getting tests passing. |
Thanks @mapsam
… On Nov 9, 2017, at 6:33 AM, Sam Matthews ***@***.***> wrote:
Thanks @springmeyer <https://github.com/springmeyer>! I'll work on getting tests passing.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#102 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABPTNRPXmTdgB5LwtlwKI2EKH8adOCwks5s0w1NgaJpZM4Pnri->.
|
@springmeyer I added a sinon spy to the mapnik.VectorTile.info method e0483b6#diff-e9d67ed2ee5f98cf552e2ad8f6190725 to assert we are only calling it once per tile. Despite your changes, it looks like |
@mapsam - sorry for the delay in responding to this one, and thanks again for helping get this out.
The test you are referring to e0483b6#diff-e9d67ed2ee5f98cf552e2ad8f6190725 looks like it is testing v1 tiles. It is expected still that mapbox-tile-copy/lib/migration-stream.js Lines 60 to 85 in 6163db5
So I think we need a test to ensure it is called only once for v2 tiles. That sound right? |
Ah, that makes sense. Thanks @springmeyer - I've updated the test with a valid v2 fixture... what do you think of this? mapbox-tile-copy/test/copy.tilelive.test.js Lines 97 to 116 in 97db9a2
|
@springmeyer updated so the spy is in the pre-existing v2 tests, plus rearranged the migration stream code to make it a little more readable. |
Great, looks good to merge and roll out when you have time @mapsam - thanks for the help! |
🍏 - thanks much @springmeyer for noticing this. Will plan on releasing a new minor version for this. |
While reviewing the migration stream code, I noticed that in the case of v2 tiles we were calling
mapnik.VectorTile.info
twice on the same buffer. This call is not cheap because it:This is likely slowing down unpacking of v2 vector tiles in a meaningful way. This PR fixes the problem.
/cc @mapbox/unpacker