Closed niklasf closed 3 years ago
Currently the encoder unconditionally makes huge allocations. I assume this is a performance tradeoff.
https://github.com/image-rs/lzw/blob/0d3c809a37574cc84684e02c96c62ef079c926c9/src/encode.rs#L251
Could there be a way to select a different tradeoff, maximum, or maybe something based on the size of the input?
Hm, yes. I suppose you could add a method to configure this buffer size or to pass in a borrowed buffer with the lifetime of the state's borrow.
Thank you! Amazing solution.
Currently the encoder unconditionally makes huge allocations. I assume this is a performance tradeoff.
https://github.com/image-rs/lzw/blob/0d3c809a37574cc84684e02c96c62ef079c926c9/src/encode.rs#L251
Could there be a way to select a different tradeoff, maximum, or maybe something based on the size of the input?