On Fri, Sep 10, 2021 at 7:52 PM Denys Vlasenko <vda.li...@googlemail.com> wrote: > I'm getting this:
> (add/remove: 96/0 grow/shrink: 6/2 up/down: 24743/-98) Total: 24645 bytes > I suspect Facebook et al do not share busybox's zeal about smaller size. > In particular, XXH64, the second-largest added object, has no > config knob to select smaller, slower version: > #if 0 > /* Simple version, good for code maintenance, but unfortunately > slow for small inputs */ > XXH64_CREATESTATE_STATIC(state); > XXH64_reset(state, seed); > XXH64_update(state, input, len); > return XXH64_digest(state); > The "if 0" code block does not compile if enabled by hand. I think it should look like this: #if 1 XXH64_state_t state; XXH64_reset(&state, seed); XXH64_update(&state, input, len); return XXH64_digest(&state); #else ( It does save around 180 bytes, not sure about the speed hit. ) > If we take this code in and start tweaking it for small size, > the backporting of future fixes will be a nightmare. I have been working on this and managed to get the overall "bloatcheck" size down to 18599 bytes. That involved removing a lot of code, including support for custom dictionaries. (As I understand it, custom dictionaries are mainly useful when dealing with a large number of very small files, not something commonly encountered in the wild.) I will try to look it over one more time and submit a patch in the next few days. It substantially reduces the amount of source code but matches your "backporting of future fixes will be a nightmare" scenario. At least it might serve as a target for how small we could get. > With b[un]zip2, we just waited until the upstream code has > fossilized enough that backporting pains stopped being a concern. I found this comment on github[1]: "There is no new magic number planned in the foreseeable future. 0xFD2FB528 is intended to be the only magic number for zstd frames." Do you think that implies that at least the basic file format is probably stable? -- Jeff [1] https://github.com/facebook/zstd/issues/768 _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox