Skip to content

Commit

Permalink
Slightly less compression makes as-needed dropping twice as fast
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Jan 4, 2024
1 parent 02e3bac commit 06d975c
Show file tree
Hide file tree
Showing 19 changed files with 1,348 additions and 1,374 deletions.
2 changes: 1 addition & 1 deletion mvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int compress(std::string const &input, std::string &output, bool gz) {
deflate_s.opaque = Z_NULL;
deflate_s.avail_in = 0;
deflate_s.next_in = Z_NULL;
deflateInit2(&deflate_s, Z_BEST_COMPRESSION, Z_DEFLATED, gz ? 31 : 15, 8, Z_DEFAULT_STRATEGY);
deflateInit2(&deflate_s, Z_DEFAULT_COMPRESSION, Z_DEFLATED, gz ? 31 : 15, 8, Z_DEFAULT_STRATEGY);
deflate_s.next_in = (Bytef *) input.data();
deflate_s.avail_in = input.size();
size_t length = 0;
Expand Down
4 changes: 2 additions & 2 deletions tests/muni/decode/multi.mbtiles.stats.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{ "zoom": 11, "x": 326, "y": 791, "bytes": 376, "compressed": true, "layers": { "muni": { "points": 14, "lines": 0, "polygons": 0, "extent": 4096 } } }
,
{ "zoom": 11, "x": 327, "y": 792, "bytes": 6533, "compressed": true, "layers": { "muni": { "points": 528, "lines": 0, "polygons": 0, "extent": 4096 } } }
{ "zoom": 11, "x": 327, "y": 792, "bytes": 6543, "compressed": true, "layers": { "muni": { "points": 528, "lines": 0, "polygons": 0, "extent": 4096 } } }
,
{ "zoom": 11, "x": 327, "y": 791, "bytes": 45265, "compressed": true, "layers": { "muni": { "points": 4284, "lines": 0, "polygons": 0, "extent": 4096 }, "subway": { "points": 19, "lines": 0, "polygons": 0, "extent": 4096 } } }
{ "zoom": 11, "x": 327, "y": 791, "bytes": 45475, "compressed": true, "layers": { "muni": { "points": 4284, "lines": 0, "polygons": 0, "extent": 4096 }, "subway": { "points": 19, "lines": 0, "polygons": 0, "extent": 4096 } } }
,
{ "zoom": 11, "x": 954, "y": 791, "bytes": 75, "compressed": true, "layers": { "muni": { "points": 12, "lines": 0, "polygons": 0, "extent": 4096 } } }
]
2 changes: 1 addition & 1 deletion tests/muni/out/-Z11_-z13_-M10000.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "13",
"minzoom": "11",
"name": "tests/muni/out/-Z11_-z13_-M10000.json.check.mbtiles",
"strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":18540,\"detail_reduced\":4,\"tile_size_desired\":10857},{\"dropped_by_rate\":6391,\"detail_reduced\":3,\"tile_size_desired\":10700},{}]",
"strategies": "[{},{},{},{},{},{},{},{},{},{},{},{\"dropped_by_rate\":18540,\"detail_reduced\":4,\"tile_size_desired\":10887},{\"dropped_by_rate\":6391,\"detail_reduced\":3,\"tile_size_desired\":10721},{}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down
1,106 changes: 553 additions & 553 deletions tests/muni/out/-Z11_-z13_-M10000_-aG.json

Large diffs are not rendered by default.

916 changes: 452 additions & 464 deletions tests/muni/out/-Z11_-z13_-M10000_-ad.json

Large diffs are not rendered by default.

532 changes: 263 additions & 269 deletions tests/muni/out/-Z11_-z13_-M10000_-pd.json

Large diffs are not rendered by default.

58 changes: 25 additions & 33 deletions tests/muni/out/-Z11_-z13_-M5000_-as.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "5",
"minzoom": "0",
"name": "tests/ne_110m_admin_0_countries/out/-ae_-zg_-M5000_--drop-smallest-as-needed.json.check.mbtiles",
"strategies": "[{\"dropped_as_needed\":174,\"tile_size_desired\":39190},{\"dropped_as_needed\":200,\"tile_size_desired\":25154},{\"dropped_as_needed\":187,\"tiny_polygons\":1,\"tile_size_desired\":21201},{\"dropped_as_needed\":154,\"tile_size_desired\":10758},{\"dropped_as_needed\":79,\"tile_size_desired\":6601},{\"tiny_polygons\":2}]",
"strategies": "[{\"dropped_as_needed\":174,\"tile_size_desired\":39241},{\"dropped_as_needed\":200,\"tile_size_desired\":25163},{\"dropped_as_needed\":187,\"tiny_polygons\":1,\"tile_size_desired\":21214},{\"dropped_as_needed\":154,\"tile_size_desired\":10758},{\"dropped_as_needed\":79,\"tile_size_desired\":6601},{\"tiny_polygons\":2}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "5",
"minzoom": "0",
"name": "tests/ne_110m_admin_0_countries/out/-z5_-M5000_--coalesce-densest-as-needed.json.check.mbtiles",
"strategies": "[{\"coalesced_as_needed\":528,\"detail_reduced\":2,\"tiny_polygons\":2,\"tile_size_desired\":39195},{\"coalesced_as_needed\":212,\"tile_size_desired\":25155},{\"coalesced_as_needed\":190,\"tiny_polygons\":1,\"tile_size_desired\":21206},{\"coalesced_as_needed\":159,\"tile_size_desired\":10751},{\"coalesced_as_needed\":51,\"tile_size_desired\":6591},{\"tiny_polygons\":1}]",
"strategies": "[{\"coalesced_as_needed\":528,\"detail_reduced\":2,\"tiny_polygons\":2,\"tile_size_desired\":39242},{\"coalesced_as_needed\":212,\"tile_size_desired\":25160},{\"coalesced_as_needed\":190,\"tiny_polygons\":1,\"tile_size_desired\":21223},{\"coalesced_as_needed\":159,\"tile_size_desired\":10749},{\"coalesced_as_needed\":51,\"tile_size_desired\":6591},{\"tiny_polygons\":1}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "5",
"minzoom": "0",
"name": "tests/ne_110m_admin_0_countries/out/-z5_-M5000_--coalesce-smallest-as-needed.json.check.mbtiles",
"strategies": "[{\"coalesced_as_needed\":1271,\"tiny_polygons\":5,\"tile_size_desired\":39195},{\"coalesced_as_needed\":1189,\"tile_size_desired\":25155},{\"coalesced_as_needed\":727,\"tiny_polygons\":1,\"tile_size_desired\":21206},{\"coalesced_as_needed\":179,\"tile_size_desired\":10751},{\"coalesced_as_needed\":73,\"tile_size_desired\":6591},{\"tiny_polygons\":1}]",
"strategies": "[{\"coalesced_as_needed\":1271,\"tiny_polygons\":5,\"tile_size_desired\":39242},{\"coalesced_as_needed\":1189,\"tile_size_desired\":25160},{\"coalesced_as_needed\":727,\"tiny_polygons\":1,\"tile_size_desired\":21223},{\"coalesced_as_needed\":179,\"tile_size_desired\":10749},{\"coalesced_as_needed\":73,\"tile_size_desired\":6591},{\"tiny_polygons\":1}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "5",
"minzoom": "0",
"name": "tests/ne_110m_admin_0_countries/out/-z5_-M5000_--drop-smallest-as-needed.json.check.mbtiles",
"strategies": "[{\"dropped_as_needed\":174,\"tile_size_desired\":39195},{\"dropped_as_needed\":202,\"tile_size_desired\":25155},{\"dropped_as_needed\":190,\"tile_size_desired\":21206},{\"dropped_as_needed\":155,\"tile_size_desired\":10751},{\"dropped_as_needed\":78,\"tile_size_desired\":6591},{\"tiny_polygons\":1}]",
"strategies": "[{\"dropped_as_needed\":174,\"tile_size_desired\":39242},{\"dropped_as_needed\":202,\"tile_size_desired\":25160},{\"dropped_as_needed\":190,\"tile_size_desired\":21223},{\"dropped_as_needed\":155,\"tile_size_desired\":10749},{\"dropped_as_needed\":78,\"tile_size_desired\":6591},{\"tiny_polygons\":1}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "5",
"minzoom": "0",
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-z5_-M500_--drop-smallest-as-needed.json.check.mbtiles",
"strategies": "[{\"dropped_as_needed\":92,\"tile_size_desired\":1377},{\"dropped_as_needed\":96,\"tile_size_desired\":1738},{\"dropped_as_needed\":115,\"tile_size_desired\":1303},{\"dropped_as_needed\":127,\"tile_size_desired\":1154},{\"dropped_as_needed\":105,\"tile_size_desired\":1228},{\"dropped_as_needed\":106,\"tile_size_desired\":1077}]",
"strategies": "[{\"dropped_as_needed\":92,\"tile_size_desired\":1385},{\"dropped_as_needed\":96,\"tile_size_desired\":1739},{\"dropped_as_needed\":115,\"tile_size_desired\":1304},{\"dropped_as_needed\":127,\"tile_size_desired\":1154},{\"dropped_as_needed\":105,\"tile_size_desired\":1228},{\"dropped_as_needed\":106,\"tile_size_desired\":1077}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "2",
"minzoom": "0",
"name": "tests/ne_110m_populated_places/out/-z0_-M10000_--drop-densest-as-needed_--extend-zooms-if-still-dropping-maximum_2.json.check.mbtiles",
"strategies": "[{\"dropped_as_needed\":219,\"tile_size_desired\":74691},{\"dropped_as_needed\":207,\"tile_size_desired\":44398},{\"dropped_as_needed\":181,\"tile_size_desired\":35126}]",
"strategies": "[{\"dropped_as_needed\":219,\"tile_size_desired\":74734},{\"dropped_as_needed\":207,\"tile_size_desired\":44415},{\"dropped_as_needed\":181,\"tile_size_desired\":35130}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "1",
"minzoom": "0",
"name": "tests/ne_110m_populated_places/out/-z1_-M10000_--coalesce-smallest-as-needed.json.check.mbtiles",
"strategies": "[{\"dropped_by_rate\":145,\"coalesced_as_needed\":74,\"tile_size_desired\":32932},{\"coalesced_as_needed\":226,\"tile_size_desired\":44398}]",
"strategies": "[{\"dropped_by_rate\":145,\"coalesced_as_needed\":74,\"tile_size_desired\":32942},{\"coalesced_as_needed\":226,\"tile_size_desired\":44415}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxzoom": "1",
"minzoom": "0",
"name": "tests/ne_110m_populated_places/out/-z1_-M10000_--drop-smallest-as-needed.json.check.mbtiles",
"strategies": "[{\"dropped_by_rate\":145,\"dropped_as_needed\":75,\"tile_size_desired\":32932},{\"dropped_as_needed\":204,\"tile_size_desired\":44398}]",
"strategies": "[{\"dropped_by_rate\":145,\"dropped_as_needed\":75,\"tile_size_desired\":32942},{\"dropped_as_needed\":204,\"tile_size_desired\":44415}]",
"type": "overlay",
"version": "2"
}, "features": [
Expand Down

0 comments on commit 06d975c

Please sign in to comment.