felt / tippecanoe

Build vector tilesets from large collections of GeoJSON features.
BSD 2-Clause "Simplified" License
906 stars 78 forks source link

Speeding up tippecanoe-overzoom #191

Closed e-n-f closed 7 months ago

e-n-f commented 7 months ago

This PR consists of many, mostly tiny, optimizations to tile reading and writing to improve the speed of tippecanoe-overzoom. There should be no externally visible impact other than greater speed. The specific changes are:

attribute

clip

decode

evaluator

main

mvt

This one has a more substantive change. The mvt_value structure previously always contained a std::string for the string value case. Now it has a shared_ptr<std::string>, which may be null in the non-string cases. The string that is pointed to may be unique to the mvt_value, or it may be shared across an entire tile, so that the text of string values is concatenated into the shared pool string instead of requiring a separate string allocation in each mvt_value.

The specific string value for each mvt_value is referenced as an off and len into the pool string. When possible, callers access the string value as a string_view or c_str instead of through a substring copy.

In addition:

overzoom

pmtiles

serial

tile-join

tile

write_json