s2: FR: Toggle compression between blocks
Jille opened this issue · 0 comments
Jille commented
I'd like to toggle uncompressed-mode between blocks when writing with the s2.Writer.
CPU time is expensive in my environment, and I'm compressing a long stream which contains regions of already S2 compressed data. I'd like to tell the s2.Writer to not even bother compressing those blocks to avoid it spending CPU time on compression and then deciding it wasn't worth it.
Ideally without pipeline stalls when having to call Flush() in between, but that might not be worth the complexity on your side. (Requiring AsyncFlush() would be fine however.)
Alternatively I could use two s2.Writers to the same destination, one with compression and one without.