Repository navigation
Conversation
collect_tags_framed reads every local tag entry of a cell and keeps those
of the elements being printed, binary-searching each entry's id among
them. Most entries of a cell belong to other elements.
It now builds an Id_Bit_Filter of the cell's ids and skips entries whose
id the filter rejects before the bound checks and the binary search.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU of 3 alternating runs:
(rel['seamark:type']; >; way['seamark:type']; >; node['seamark:type']; ); out meta;
4.66 s -> 3.66 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
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.
Stacked on #1 (
faster-id-predicate), which addsId_Bit_Filter. The tables compare against #1's branch.Fixes #250.
Change
collect_tags_framed(data/tag_store.h) builds anId_Bit_Filterof the cell's ids and skips tag entries whose id the filter rejects, before the id bounds and the binary search. It also looks the cell's ids up once.One file, 7 lines added, 3 removed. No change to the database format, the query API or the results.
Impact
US northeast full-history extract (Geofabrik), warm cache, 4-core VM. Builds alternate, median user+sys CPU of 3 runs. The queries: the 1° × 1° maxheight query from #242 in three boxes (dense, sparse, empty) and their 0.99999° versions, and the 20 heaviest query templates on the public servers in June 2026 moved to Boston and New England coordinates (p01–p20). Base is #1's branch (70f18bd).
Queries that print the tags of many elements gain most: p07 −21%, p18 −20%, p11 −16%.
With #138. On
all-changes, #138 replaces the binary search here with a forward cursor (contains_from_cursor); the bit filter goes in front of that cursor the same way (skipping calls is safe: the cursor restarts when an id isn't greater than the previous one). There it takes dense_1 from 2.54 G to 2.21 G instructions.Queries
dense_1:
sparse_1:
empty_1:
The 0.99999° versions shrink each box's north and east edges by 0.00001°. p01 is dense_1.
p01 (maxheight bbox1deg)
p02 (amenities around union)
p03 (admin in area)
p04 (brands bbox ci)
p05 (global data center)
p06 (food around regex)
p07 (global seamark recurse)
p08 (global cameras)
p09 (3d buildings bbox)
p10 (tourism around25k)
p11 (brownfield bigbbox)
p12 (clinic name ci around25k)
p13 (map call meta)
p14 (area by name worship)
p15 (tiny bbox many keys geom)
p16 (hgv restrictions bbox)
p17 (anchored regex around)
p18 (fuel bigbbox)
p19 (venues bbox name ci)
p20 (office around25k)
Testing
fuzz,historyandpropsstarted by hand (workflow_dispatchwith this branch asref), since those workflows run on pull requests only againstmaster.Limitations and open questions
Generated by Claude Code