lz4-napi icon indicating copy to clipboard operation
lz4-napi copied to clipboard

expose speed / high compression option

Open Awendel opened this issue 2 years ago • 2 comments

I saw that the original library supports passing on a speed / compression strength option.

It's mainly affects compression speed and has the classic tradeoff between compression strength and cpu cycles spend. Decompression speed shouldn't be affected

Would maybe be nice to also add this to the library.

API could be set to the following:

compressSync(input:buffer, compressionLevel?:number, dict?:Buffer)

so that the latter are both optional but set to fastest by default (0 I beliebe)

Awendel avatar Sep 25 '22 15:09 Awendel

The current library used doesn't support this feature for now.

antoniomuso avatar Sep 26 '22 07:09 antoniomuso

Ah, I see, since it's dependent on the Rust implementation.

So this seems to be the blocking issue for now:

https://github.com/PSeitz/lz4_flex/issues/21

and if it's fixed there, one could also incorporate it here

Awendel avatar Sep 26 '22 08:09 Awendel