mapbox / mapbox/vtquery

Filter by geometries by bbox

Open
#55 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
45
Forks
14
PR merge metrics
No merged PRs in 30d

Description

I ran the slowest/most intense benchmark (query: all things - dense nine tiles) on OS X using node bench/vtquery.bench.js --iterations 5000 --concurrency 1 and a patch to disable all other tests besides query: all things - dense nine tiles. Then I profiled in Activity Monitor during the run.

What I see is:

My interpretation is that:

  • Parsing with vtzero is extremely cheap
  • Running closest_point is also pretty cheap
  • Decoding into mapbox::geometry objects is expensive due to memory allocation and deallocation

And therefore our overwhelming bottleneck (where > 50% of the time is taken) is mapbox::vector_tile::extract_geometry (https://github.com/mapbox/vector-tile/blob/97d8b89fe635f117ce7de25790028a65d9ce5172/include/mapbox/vector_tile.hpp#L15)

So, to reduce the latency of scenarios like this (large radius and multiple tiles) we'll need to speed up mapbox::vector_tile::extract_geometry.

Profiling output: https://callgraph.herokuapp.com/76849341d35452543e35c504964dcb94#thread-6

/cc @mapsam @flippmoke

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bench/vtquery.bench.js and run the documented node bench/vtquery.bench.js --iterations 5000 --concurrency 1 benchmark for query: all things - dense nine tiles. Profile the path through mapbox::vector_tile::extract_geometry, including geometry allocation and deallocation, and compare it with closest_point and vtzero calls. Done means reducing latency for large-radius, multiple-tile queries without changing query behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.