Consistently use bincode's Encode/Decode to avoid issues with
incompatible serde features. Support for storing some temporary files as
JSON is removed.
The size of the "processed" directory is reduced by ~8% with the new
default encoding of bincode 2. Performance is more or less unaffected.
Only use IndexSet for deduplication while processing the biome; when
deserializing, no deduplication is required, so using a Vec is faster
(besides IndexSet missing non-serde support for bincode 2).
bincode 2 required Rust 1.85, so our options are to switch to Alpine
edge or to use the rust image. While using the rust image results in a
statically linked binary, this does not actually increase the size of
the image, as we were already using jemalloc, so almost nothing of libc
is actually used.
zlib-rs provides the same performance as zlib-ng with minedmap, while
reducing the amount of C code and avoiding the external build dependency
on CMake.
Including tini fixes forwarding signals to MinedMap, allowing to
interrupt it using Ctrl-C. The base tools may be used to add a wrapper
script to configure MinedMap with environment variables.
As the Alpine base is included now, we can switch from the rust:alpine
image to alpine:latest, resulting in MinedMap to be linked dynamically.
Looking at inotify dumps, it appears like because of bad implementation
choices, Minecraft's level.dat may not exist for a brief moment between
moving the old file to level.dat_old and moving a new version into place.
Add a fallback to level.dat_old, so generation will not fail if were
unlucky enough to hit this moment.
Introduce the new features jemalloc (set jemalloc global allocator
unconditionally) and jemalloc-auto (set jemalloc global allocator on
musl-based targets to fix multithreaded performance, see [1]).
Because cargo does not support target-specific features or feature
defaults, the default is handled using a helper crate
minedmap-default-alloc.
[1] https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/
WebP can be selected by passing `--image-format webp` on the command
line. For typical Minecraft worlds, this results in a size reduction of
10-15% without increasing processing time.