s-bsdipa, a mutation of bsdiff
==============================

Colin Percival's BSDiff, imported from FreeBSD and mutated.
BSDiff: create or apply binary difference patch.
In general:

- one includes s-bsdipa-lib.h and uses the all-in-memory s_bsdipa_diff()
  and s_bsdipa_patch() functions to create and apply patches.
  Ie, (for example mmap(2)ed) memory in, (heap) memory out.

- the actually necessary compression / storage preparation can be
  achieved easily by including s-bsdipa-io.h after defining s_BSDIPA_IO
  as desired, and using s_bsdipa_io_write() and _read().  These still do
  not perform direct I/O, but call a supplied hook with fully prepared
  buffers, and store in (heap) memory, respectively.

  (As said there, linker flags for the chosen compression method
  or library must be provided by whoever uses the s-bsdipa-io.h layer.)

- the program s-bsdipa present in an equally named directory of the
  source repository can be inspected for a complete example picture.
  It also times execution and tracks memory usage, for your interest.

- in general the lib/ directory of the source repository is self-
  contained, and may be copied for inclusion in other projects.

- Please see the introductional header comments of s-bsdipa-lib.h and
  s-bsdipa-io.h for more.

Licenses (full text included in s-bsdipa-lib.h):
  libdivsufsort(/LICENSE): MIT
  s-bsdiff.c, s-bspatch.c: BSD-2-clause
  s-bsdipa-lib.h, s-bsdipa-io.h, s-bsdipa.c: ISC

Repository:
  browse: https?://git.sdaoden.eu/browse/s-bsdipa.git
  clone:  https?://git.sdaoden.eu/scm/s-bsdipa.git

  alternatively: https://github.com/sdaoden/s-bsdipa

Contact: steffen at sdaoden dot eu.

---

Some data points follow.  (32 byte "magic window" is a good fit.)

Input data files:
  z/0: empty files.
  z/1: one byte files (both U+000A).
  z/h: songtext of the Sex Pistol's "Holidays in the Sun".
      $ stat -c%s z/h/{0,1}
      1609
      1408
      $ diff -u z/h/{0,1} | wc -lwc
      44     284    1483
  z/m1: complete email as sent / as received back from mailman ML.
      $ stat -c%s z/m1/{0,1}
      7368
      11754
      $ diff -u z/m1/{0,1} | wc -lwc
      311    1473   18138
  z/d: manual of S-nail v14.9.25 / devel as of 2024-12-??.
      $ stat -c%s z/d/{0,1}
      428420
      392542
      $ diff -u z/d/{0,1} | wc -lwc
      19555   93132  563863
  z/b: gzip compressed data, from Unix, original size [.] 75816960.
      $ stat -c%s z/b/{0,1}
      11704421
      11706141
      $ cmp -l z/b/{0,1} | wc -l
      cmp: EOF on z/b/0 after byte 11704421
      11655280

Script:

  make clean
  CFLAGS='-O2 -DNDEBUG' make s_BSDIPA_32=y s_BSDIPA_CFLAGS='$(SUFX)' all
  stat -c%s lib/libsbsdipa.a
  cp s-bsdipa/s-bsdipa s-bsdipa32
  make clean
  CFLAGS='-O2 -DNDEBUG' make s_BSDIPA_CFLAGS='$(SUFX)' all
  stat -c%s lib/libsbsdipa.a
  cp s-bsdipa/s-bsdipa s-bsdipa64
  make clean

  for i in 4 8 16 32 64 128 256 512; do
    echo ===$i===
    for d in /tmp/z/{0,1,h,m1,d,b}; do
      echo
      echo "=$i: $d: 32="
      ./s-bsdipa32 !diff/$i $d/0 $d/1 $d/$i.p32
      ./s-bsdipa32 !patch $d/1 $d/$i.p32 $d/$i.r32
      cmp -s $d/0 $d/$i.r32
      echo
      ./s-bsdipa64 !diff/$i $d/0 $d/1 $d/$i.p64
      ./s-bsdipa64 !patch $d/1 $d/$i.p64 $d/$i.r64
      cmp -s $d/0 $d/$i.r64
    done
  done

  rm -f s-bsdipa32 s-bsdipa64

Outcome:

  ...
  38506
  ...
  40274
  ...

  ===4===

  =4: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =4: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =4: /tmp/z/h: 32/64
  # 119 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43326 peek=41717 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 126 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:002 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43506 peek=41897 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =4: /tmp/z/m1: 32/64
  # 3621 result bytes | 13 allocs: all=603561 peek=317557 bytes
  # Algorithm 0:005 secs, I/O 0:001 secs
  # 7368 result bytes | 4 allocs: all=56092 peek=48724 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3699 result bytes | 13 allocs: all=915225 peek=627745 bytes
  # Algorithm 0:006 secs, I/O 0:004 secs
  # 7368 result bytes | 4 allocs: all=57520 peek=50152 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =4: /tmp/z/d: 32/64
  # 84033 result bytes | 434 allocs: all=2872225 peek=2261761 bytes
  # Algorithm 0:048 secs, I/O 0:217 secs
  # 428420 result bytes | 4 allocs: all=1105364 peek=1065436 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  # 92707 result bytes | 434 allocs: all=4914173 peek=4095101 bytes
  # Algorithm 0:033 secs, I/O 0:348 secs
  # 428420 result bytes | 4 allocs: all=1313960 peek=1274032 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  =4: /tmp/z/b: 32/64
  # 11089310 result bytes | 372 allocs: all=60243574 peek=58792158 bytes
  # Algorithm 15:722 secs, I/O 0:986 secs
  # 11704421 result bytes | 4 allocs: all=23626802 peek=23586874 bytes
  # Algorithm 0:009 secs, I/O 0:024 secs

  # 11099411 result bytes | 372 allocs: all=107509414 peek=105879894 bytes
  # Algorithm 16:983 secs, I/O 1:148 secs
  # 11704421 result bytes | 4 allocs: all=23804834 peek=23764906 bytes
  # Algorithm 0:008 secs, I/O 0:025 secs

  ===8===

  =8: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =8: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =8: /tmp/z/h: 32/64
  # 119 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43326 peek=41717 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 126 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43506 peek=41897 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =8: /tmp/z/m1: 32/64
  # 3287 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54940 peek=47572 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3306 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:002 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=55216 peek=47848 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =8: /tmp/z/d: 32/64
  # 80567 result bytes | 304 allocs: all=2806185 peek=2261761 bytes
  # Algorithm 0:039 secs, I/O 0:176 secs
  # 428420 result bytes | 4 allocs: all=1041392 peek=1001464 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  # 87431 result bytes | 304 allocs: all=4784173 peek=4095101 bytes
  # Algorithm 0:041 secs, I/O 0:296 secs
  # 428420 result bytes | 4 allocs: all=1186016 peek=1146088 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  =8: /tmp/z/b: 32/64
  # 11156286 result bytes | 132 allocs: all=60121654 peek=58792158 bytes
  # Algorithm 15:997 secs, I/O 0:712 secs
  # 11704421 result bytes | 4 allocs: all=23508398 peek=23468470 bytes
  # Algorithm 0:008 secs, I/O 0:023 secs

  # 11159605 result bytes | 132 allocs: all=107269414 peek=105879894 bytes
  # Algorithm 17:044 secs, I/O 0:798 secs
  # 11704421 result bytes | 4 allocs: all=23568026 peek=23528098 bytes
  # Algorithm 0:007 secs, I/O 0:025 secs

  ===16===

  =16: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =16: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =16: /tmp/z/h: 32/64
  # 121 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43314 peek=41705 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 127 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43482 peek=41873 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =16: /tmp/z/m1: 32/64
  # 3269 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54784 peek=47416 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3275 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54904 peek=47536 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =16: /tmp/z/d: 32/64
  # 70269 result bytes | 117 allocs: all=2711189 peek=2261761 bytes
  # Algorithm 0:067 secs, I/O 0:080 secs
  # 428420 result bytes | 4 allocs: all=949280 peek=909352 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  # 72544 result bytes | 117 allocs: all=4597173 peek=4095101 bytes
  # Algorithm 0:066 secs, I/O 0:135 secs
  # 428420 result bytes | 4 allocs: all=1001792 peek=961864 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  =16: /tmp/z/b: 32/64
  # 11207903 result bytes | 65 allocs: all=60087618 peek=58792158 bytes
  # Algorithm 15:973 secs, I/O 0:581 secs
  # 11704421 result bytes | 4 allocs: all=23475374 peek=23435446 bytes
  # Algorithm 0:007 secs, I/O 0:023 secs

  # 11209059 result bytes | 65 allocs: all=107202414 peek=105879894 bytes
  # Algorithm 17:171 secs, I/O 0:614 secs
  # 11704421 result bytes | 4 allocs: all=23501978 peek=23462050 bytes
  # Algorithm 0:007 secs, I/O 0:022 secs

  ===32===

  =32: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =32: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =32: /tmp/z/h: 32/64
  # 151 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43254 peek=41645 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 157 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43362 peek=41753 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =32: /tmp/z/m1: 32/64
  # 3308 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54748 peek=47380 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3309 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:002 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54832 peek=47464 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =32: /tmp/z/d: 32/64
  # 71148 result bytes | 49 allocs: all=2676645 peek=2261761 bytes
  # Algorithm 0:080 secs, I/O 0:032 secs
  # 428420 result bytes | 4 allocs: all=915836 peek=875908 bytes
  # Algorithm 0:001 secs, I/O 0:001 secs

  # 72120 result bytes | 49 allocs: all=4529173 peek=4095101 bytes
  # Algorithm 0:088 secs, I/O 0:059 secs
  # 428420 result bytes | 4 allocs: all=934904 peek=894976 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  =32: /tmp/z/b: 32/64
  # 11256445 result bytes | 35 allocs: all=60072378 peek=58792158 bytes
  # Algorithm 16:049 secs, I/O 0:484 secs
  # 11704421 result bytes | 4 allocs: all=23460830 peek=23420902 bytes
  # Algorithm 0:007 secs, I/O 0:022 secs

  # 11256902 result bytes | 35 allocs: all=107172414 peek=105879894 bytes
  # Algorithm 18:136 secs, I/O 0:504 secs
  # 11704421 result bytes | 4 allocs: all=23472890 peek=23432962 bytes
  # Algorithm 0:008 secs, I/O 0:023 secs

  ===64===

  =64: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =64: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =64: /tmp/z/h: 32/64
  # 169 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43230 peek=41621 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 172 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43314 peek=41705 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =64: /tmp/z/m1: 32/64
  # 3349 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54700 peek=47332 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3349 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54736 peek=47368 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =64: /tmp/z/d: 32/64
  # 78099 result bytes | 28 allocs: all=2665977 peek=2261761 bytes
  # Algorithm 0:095 secs, I/O 0:020 secs
  # 428420 result bytes | 4 allocs: all=905192 peek=865264 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  # 78479 result bytes | 28 allocs: all=4508173 peek=4095101 bytes
  # Algorithm 0:103 secs, I/O 0:033 secs
  # 428420 result bytes | 4 allocs: all=913616 peek=873688 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  =64: /tmp/z/b: 32/64
  # 11319720 result bytes | 21 allocs: all=60065266 peek=58792158 bytes
  # Algorithm 16:854 secs, I/O 0:418 secs
  # 11704421 result bytes | 4 allocs: all=23454110 peek=23414182 bytes
  # Algorithm 0:006 secs, I/O 0:022 secs

  # 11319894 result bytes | 21 allocs: all=107158414 peek=105879894 bytes
  # Algorithm 17:617 secs, I/O 0:419 secs
  # 11704421 result bytes | 4 allocs: all=23459450 peek=23419522 bytes
  # Algorithm 0:006 secs, I/O 0:023 secs

  ===128===

  =128: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =128: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =128: /tmp/z/h: 32/64
  # 204 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43206 peek=41597 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 209 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43266 peek=41657 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =128: /tmp/z/m1: 32/64
  # 3349 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54700 peek=47332 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3349 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:002 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54736 peek=47368 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =128: /tmp/z/d: 32/64
  # 86604 result bytes | 19 allocs: all=2661405 peek=2261761 bytes
  # Algorithm 0:108 secs, I/O 0:019 secs
  # 428420 result bytes | 4 allocs: all=900776 peek=860848 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  # 86739 result bytes | 19 allocs: all=4499173 peek=4095101 bytes
  # Algorithm 0:117 secs, I/O 0:024 secs
  # 428420 result bytes | 4 allocs: all=904784 peek=864856 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  =128: /tmp/z/b: 32/64
  # 11408130 result bytes | 14 allocs: all=60061710 peek=58792158 bytes
  # Algorithm 16:418 secs, I/O 0:365 secs
  # 11704421 result bytes | 4 allocs: all=23450714 peek=23410786 bytes
  # Algorithm 0:006 secs, I/O 0:022 secs

  # 11408202 result bytes | 14 allocs: all=107151414 peek=105879894 bytes
  # Algorithm 17:739 secs, I/O 0:366 secs
  # 11704421 result bytes | 4 allocs: all=23452658 peek=23412730 bytes
  # Algorithm 0:006 secs, I/O 0:022 secs

  ===256===

  =256: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =256: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =256: /tmp/z/h: 32/64
  # 284 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43182 peek=41573 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 287 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43218 peek=41609 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =256: /tmp/z/m1: 32/64
  # 3378 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54688 peek=47320 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3378 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:002 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54712 peek=47344 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =256: /tmp/z/d: 32/64
  # 96689 result bytes | 14 allocs: all=2658865 peek=2261761 bytes
  # Algorithm 0:120 secs, I/O 0:020 secs
  # 428420 result bytes | 4 allocs: all=898544 peek=858616 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  # 96721 result bytes | 14 allocs: all=4494173 peek=4095101 bytes
  # Algorithm 0:132 secs, I/O 0:021 secs
  # 428420 result bytes | 4 allocs: all=900320 peek=860392 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  =256: /tmp/z/b: 32/64
  # 11456467 result bytes | 12 allocs: all=60060694 peek=58792158 bytes
  # Algorithm 17:334 secs, I/O 0:378 secs
  # 11704421 result bytes | 4 allocs: all=23449466 peek=23409538 bytes
  # Algorithm 0:006 secs, I/O 0:023 secs

  # 11456494 result bytes | 12 allocs: all=107149414 peek=105879894 bytes
  # Algorithm 19:594 secs, I/O 0:353 secs
  # 11704421 result bytes | 4 allocs: all=23450162 peek=23410234 bytes
  # Algorithm 0:005 secs, I/O 0:023 secs

  ===512===

  =512: /tmp/z/0: 32/64
  # 11 result bytes | 8 allocs: all=284485 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 11 result bytes | 8 allocs: all=284489 peek=284481 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 0 result bytes | 3 allocs: all=7160 peek=7160 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =512: /tmp/z/1: 32/64
  # 24 result bytes | 9 allocs: all=284998 peek=284990 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39942 peek=39941 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 24 result bytes | 9 allocs: all=285498 peek=285482 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1 result bytes | 4 allocs: all=39954 peek=39953 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =512: /tmp/z/h: 32/64
  # 483 result bytes | 11 allocs: all=555402 peek=286598 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43158 peek=41549 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 486 result bytes | 11 allocs: all=824698 peek=539218 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs
  # 1609 result bytes | 4 allocs: all=43170 peek=41561 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =512: /tmp/z/m1: 32/64
  # 3378 result bytes | 11 allocs: all=602545 peek=317557 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54688 peek=47320 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  # 3378 result bytes | 11 allocs: all=913225 peek=627745 bytes
  # Algorithm 0:001 secs, I/O 0:000 secs
  # 7368 result bytes | 4 allocs: all=54712 peek=47344 bytes
  # Algorithm 0:000 secs, I/O 0:000 secs

  =512: /tmp/z/d: 32/64
  # 106781 result bytes | 12 allocs: all=2657849 peek=2261761 bytes
  # Algorithm 0:139 secs, I/O 0:021 secs
  # 428420 result bytes | 4 allocs: all=897524 peek=857596 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  # 106780 result bytes | 12 allocs: all=4492173 peek=4095101 bytes
  # Algorithm 0:148 secs, I/O 0:021 secs
  # 428420 result bytes | 4 allocs: all=898280 peek=858352 bytes
  # Algorithm 0:000 secs, I/O 0:001 secs

  =512: /tmp/z/b: 32/64
  # 11479775 result bytes | 11 allocs: all=60060186 peek=58792158 bytes
  # Algorithm 16:973 secs, I/O 0:355 secs
  # 11704421 result bytes | 4 allocs: all=23449118 peek=23409190 bytes
  # Algorithm 0:006 secs, I/O 0:021 secs

  # 11479797 result bytes | 11 allocs: all=107148414 peek=105879894 bytes
  # Algorithm 18:078 secs, I/O 0:354 secs
  # 11704421 result bytes | 4 allocs: all=23449466 peek=23409538 bytes
  # Algorithm 0:005 secs, I/O 0:021 secs

# s-ts-mode
