systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.44k stars 229 forks source link

subdivide blocks if needed in Phase::Relations #586

Closed cldellow closed 9 months ago

cldellow commented 9 months ago

This is a small quality-of-life tweak for people iterating on a theme on a small extract.

I often test on a Nova Scotia extract. It's big enough to test many things, but small enough to be fast to process, about 25 seconds. 6 seconds are spent in Phase::Relations processing.

The extract has 1,647 blocks, split roughly:

Thus, most of my CPU cores are idle during Phase::Relations, as there are not enough blocks to go around.

This is doubly bad, as a block of relations takes much longer than a block of nodes or ways, due to the more complex geometries involved.

This PR changes Tilemaker such that if it sees the relations phase has too few blocks, it artificially subdivides them in order to keep the CPUs busy.

This reduces my time for Nova Scotia to about 20 seconds.

cldellow commented 9 months ago

This will have conflicts with https://github.com/systemed/tilemaker/pull/590, so I revived it over there in https://github.com/systemed/tilemaker/pull/590/commits/1f38c9af75b6fe76aa58bae7e094b6101491a76c.