mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 22:33:08 +00:00
Writer::raster formatted every sample byte with write!("{:02X}") into a
separate String and then copied that String into the file body. The new
Writer::push_hex looks each nibble up in a 16-digit table and appends the
comment lines straight to the body, so a large image no longer holds a
second copy of its hex text. The written bytes are unchanged: upper-case
digits, 60 per `%` line, a newline after the last line and no line for
an empty image.
On the 36 MB of samples of a 12 MP RGB image, the hex step took a median
of 735.5 ms before and 90.8 ms after (7 runs each, both versions in one
release process). The gain matters on documents with large images.