
c ya,
nco2k
I never heard of it but the source codes are very smallnco2k wrote:when it comes to speed, lz4 is probably the best choice. it would be really cool to have it.![]()
but is it?!?nco2k wrote:when it comes to speed, lz4 is probably the best choice.
Code: Select all
; OSX 10.11+
#COMPRESSION_LZ4 = $100
#COMPRESSION_ZLIB = $205
#COMPRESSION_LZMA = $306
#COMPRESSION_LZ4_RAW = $101
#COMPRESSION_LZFSE = $801
ImportC "-lcompression"
compression_encode_buffer(*dst_buffer, dst_size, *src_buffer, src_size, *scratch_buffer, algorithm)
compression_decode_buffer(*dst_buffer, dst_size, *src_buffer, src_size, *scratch_buffer, algorithm)
EndImport
*buf1 = AllocateMemory(99999)
*buf2 = AllocateMemory(99999)
*buf3 = AllocateMemory(99999)
csize = compression_encode_buffer(*buf2, 99999, *buf1, 99999, #Null, #COMPRESSION_LZ4)
usize = compression_decode_buffer(*buf3, 99999, *buf2, csize, #Null, #COMPRESSION_LZ4)
Debug csize
Debug usize
It tops ratio in benchmark but yeah is cpu and ram consuming. For cheap hardware I'd use deflate or even just a 64MB string-replace binary header in a quad separated binary file using a low-priority delayed thread splitting where needed and with page/swap support.Keya wrote:i dont know about LZMA2 specifically but LZMA is super strong compression ratio but comes at the price of being very slow for both compression & decompression. But LZMA2 doesn't seem to be much of a change to LZMA's actual compression, it seems more like structural changes to support things like uncompressed data also for more flexibility (i could be wrong, just my impression from reading)