Added LZ4 compressed binary images
This generates a compressed binary image using the LZ4 compressor as described here. The Spin2 preferences page has a new option to enable the compression.
From the command line compiler use the -z switch to enable the compression spinc -u -z Hello.spin2
What kind of ratios are you getting? (especially with large bytecode projects, I never actually tested it for that). I looked at the code and you're using compression level 12 - I think(TM) the java library counts differently and 17 is the maximum (which is what you want, max level LZ4HC is still plenty fast)
@Wuerfel_21 said:
What kind of ratios are you getting? (especially with large bytecode projects, I never actually tested it for that). I looked at the code and you're using compression level 12 - I think(TM) the java library counts differently and 17 is the maximum (which is what you want, max level LZ4HC is still plenty fast)
I tried with MAX_COMPRESSION_LEVEL (17) but generated files larger by 1 or 2 bytes, at least with the few files I tried.
With 12 it generates files exactly as your example compression.
Comments
What kind of ratios are you getting? (especially with large bytecode projects, I never actually tested it for that). I looked at the code and you're using compression level 12 - I think(TM) the java library counts differently and 17 is the maximum (which is what you want, max level LZ4HC is still plenty fast)
I tried with MAX_COMPRESSION_LEVEL (17) but generated files larger by 1 or 2 bytes, at least with the few files I tried.
With 12 it generates files exactly as your example compression.
Ah, interesting. Maybe that's some oddity of jvm vs native implementations. So all is good.