Skip to content

Parallelise in chunks for extent calc and vertex counting + cache PROJ transform per GLB export worker#89

Merged
Ylannl merged 3 commits into
developfrom
parallel-extent-counting
Apr 28, 2026
Merged

Parallelise in chunks for extent calc and vertex counting + cache PROJ transform per GLB export worker#89
Ylannl merged 3 commits into
developfrom
parallel-extent-counting

Conversation

@Ylannl

@Ylannl Ylannl commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Extent calculation now uses cjindex ref pages, splits each page into 2_048-feature chunks, and processes those chunks with Rayon using thread-local CityIndex readers. Grid indexing now does the same: it no longer serially decodes a full page before parallel processing; decoding plus selected_geometry_stats plus vertex counting now happen per parallel chunk.
The final grid integration is still serial because it assigns stable feature ids and mutates the dense grid. That part should be much smaller than decoding/stat/ counting, and keeping it serial preserves output order.

This gives me a 30% speedup with 8 threads for the ams-up data.

Next was an issue with PROJ that was reinitialising the CRS transform for the GLB writer for every tile. This was fixed by doing this once per worker and then caching and reusing it.

That gave another speedup of ~60-70%.

A bit more details in ADR 009. Overal this brought down the processing time from 1m59 to 27s.

@Ylannl Ylannl changed the title Parallelise in chunks for extent calc and vertex counting Parallelise in chunks for extent calc and vertex counting + chache PROJ transform per GLB export worker Apr 28, 2026
@Ylannl Ylannl changed the title Parallelise in chunks for extent calc and vertex counting + chache PROJ transform per GLB export worker Parallelise in chunks for extent calc and vertex counting + cache PROJ transform per GLB export worker Apr 28, 2026
@Ylannl
Ylannl merged commit a328103 into develop Apr 28, 2026
1 check passed
@Ylannl
Ylannl deleted the parallel-extent-counting branch April 28, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant