mapbox / mapbox/vector-tile

Possible optimization in v2 branch

Open
#36 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.x
Dominant language
C++
Stars
52
Forks
33
PR merge metrics
No merged PRs in 30d

Description

The geometry decoding in https://github.com/mapbox/vector-tile/blob/2.x/include/mapbox/vector_tile/handlers.hpp works by first creating "multi" geometries of the given type. If later the geometry turns out to only contain a single point, linestring, or polygon, the first geometry of the "multi" is returned. In practice most geometries are probably not multi, so creating this extra indirection (which internally is a std::vector) and then discarding it could have measurble performance impact.

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 in include/mapbox/vector_tile/handlers.hpp, focusing on the geometry decoding path described in the issue. Compare representative single and multi-geometry cases and measure whether the temporary multi-geometry allocation affects performance. Done means a measured optimization is identified or ruled out without changing decoding behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.