Repository navigation
Conversation
Unmapping and deleting the ~300 1-GB store files of a planet run took ~30 s on one thread after the output was complete. Release them from up to 16 threads; fall back to one if threads can't be started. Planet: "Filled the tileset" -> exit 30 s -> 8 s (-73%), about 1.3% of total wall.
This was referenced Oct 31, 2026
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.
Gain (planet,
--store): time from finished output to process exit 30 s → 8 s (−73%; −22 s, about 1.3% of a 1,650 s run). Output unchanged.With
--store, tilemaker keeps its stores in memory-mapped files of 1 GB each. At exit, the staticmmap_dir_tdestructor unmaps and deletes them one after another. For the planet that is ~140 GB in ~300 files, and it takes about 30 s on one thread after the output is already complete.This PR releases the files from up to 16 threads (capped by the number of cores). Unmapping different files and deleting them doesn't contend much: the kernel frees each file's pages under a shared lock, and each deletion works on its own inode. It stays in the same destructor, after everything that points into the mapped files is gone. If a thread can't be started, the remaining files are released as before.
Planet, PMTiles, 32 threads,
--store --fastA Germany run with
--storeexits normally and leaves the store directory empty.🤖 Generated with Claude Code