Repository navigation
Conversation
dktue
force-pushed
the
perf/lossy-foreach-set
branch
from
November 16, 2026 10:58
9cb79ea to
a353a67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gain: tile filtering above z14 no longer scales with 4^zoom. Monaco at maxzoom 17: filtering z15/z16/z17 11.4 s / 43.0 s / 174.5 s → 0 ms; whole run 239.3 s → 0.47 s (−99.8%). Same tiles and features.
Tile filtering for zooms above 14 tested every possible tile coordinate:
LossyTileCoordinatesSet(used for z15+) had noforEachSetoverride, so the generic loop calledtest()4^zoom times, e.g. 2^34 at z17, whatever the size of the area.On Monaco with maxzoom 17 that is 11 s for z15, 43 s for z16 and 175 s for z17, so 239 s of a 239 s run. For larger areas or z18 it grows to many minutes, independent of the actual number of tiles.
LossyTileCoordinatesSet::forEachSetnow expands the tiles of the underlying (z14) set into their children. It keeps the documented x-major, y-minor order: one column of underlying tiles becomesscalecolumns.Monaco, OpenMapTiles config with maxzoom/basezoom 17,
--threads 1:Adds a unit test comparing
forEachSeton a wrapped set with a full scan, including the order; it also passes on the old code.🤖 Generated with Claude Code