Page 1 of 1

bzip3 compression

Posted: Mon Jul 29, 2024 10:53 am
by Thorium
bzip3 is a compression algorithm/library which is meant as a successor to bzip2, but from a different developer.

It is lightning fast and can outperform LZMA on very large files in compression ratio. In my tests LZMA has much better compression ratio on small files.
This is probably the best lib for a balanced compression ratio and speed balance.

https://github.com/kspalaiologos/bzip3

I compiled a static lib for Windows and made a PB include to use it in PureBasic.
Download

Re: bzip3 compression

Posted: Tue Aug 20, 2024 11:30 am
by Thorium
Updated the lib with 2 crash fixes. It's not a new official release but can't have it crash, so i included the fixes and recompiled it.
There is another problem in which compression fails with status ok in a specific case, which should be fixed soon by the author of bzip3.

Re: bzip3 compression

Posted: Tue Aug 20, 2024 6:32 pm
by Fred
It seems to be using the LGPL license which exclude static linking unless you open all your source. Using it as a DLL is fine though.

Re: bzip3 compression

Posted: Tue Aug 20, 2024 8:10 pm
by skywalk
Thanks, this does look very promising. 8)
FWIW, the LGPL license allows static linking with a catch. Your app must allow end users to upgrade or downgrade any LGPL content. Easy for dlls. With static libs, you have to recompile your source code. So, end users could demand your object files to perform their own compilations.

Re: bzip3 compression

Posted: Tue Aug 20, 2024 10:04 pm
by skywalk
Question, how did you compile on Windows? Using cygwin?

Re: bzip3 compression

Posted: Sat Aug 24, 2024 8:34 pm
by Thorium
skywalk wrote: Tue Aug 20, 2024 10:04 pm Question, how did you compile on Windows? Using cygwin?
I used Visual Studio 2022 and CMake.
I tweaked the settings in the generated project to compile it as a static lib and with full code optimization.

Re: bzip3 compression

Posted: Sat Aug 24, 2024 8:36 pm
by Thorium
Fred wrote: Tue Aug 20, 2024 6:32 pm It seems to be using the LGPL license which exclude static linking unless you open all your source. Using it as a DLL is fine though.
I wasnt that concerned about the license. But if anyone does not want to open their source and needs the DLL, i can compile one, if they can't do it themself, no problem.