-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FastLZ format #2750
Comments
Do |
I guess I know why:
Here's my feed back about your proposed format:
WDYT? |
Another thing to consider is the community around the compression algorithm and format. Looking from the FastLZ's repository, there's no commit since 2007. If you don't mind, it would be nice if we could focus on more actively maintained formats like LZ4. Also, according to the benchmark from ning, LZ4, Snappy, and LZF are the winners across multiple test cases, although they did not include FastLZ in the list. What do you think? |
@trustin nign considered FastLZ algorithm but said that FastLZ doesn't have a Java version (see at the bottom of Codecs included). But I found jfastlz library. FastLZ (according to sources) has good results:
and may be used for real-time compression/decompression. FastLZ is used by Apache Traffic Server and PHP-memcached. But they have their own header format, for example in Apache Traffic Server: struct RamCacheCLFUSEntry {
INK_MD5 key;
uint32_t auxkey1;
uint32_t auxkey2;
uint64_t hits;
uint32_t size; // memory used including paddding in buffer
uint32_t len; // actual data length
uint32_t compressed_len;
union {
struct {
uint32_t compressed:3; // compression type
uint32_t incompressible:1;
uint32_t lru:1;
uint32_t copy:1; // copy-in-copy-out
} flag_bits;
uint32_t flags;
};
LINK(RamCacheCLFUSEntry, lru_link);
LINK(RamCacheCLFUSEntry, hash_link);
Ptr<IOBufferData> data;
}; They use only original What about your feed back:
New proposal:
Options: |
OK. The proposed frame format looks reasonable. Please go ahead and make modification. Please ping me once it's ready for a review. |
Superceded by #2755 |
I'm trying to implement FastLZ compression codec for Netty.
Official web site: http://fastlz.org/
Official repo: https://code.google.com/p/fastlz/
Java port: https://code.google.com/p/jfastlz/
These resources doesn't have a format description so I read a source code.
FastLZ compressor (fastlz.c / JFastLZ.java) only compresses the data. So at the end of compression you will have a compressed array without any additional information (chunk length / original length / etc.). All additional information for decompression will be added by 6PACK (6pach.c / JFastLZPack.java). 6PACK is only a file compressor. And if you compress a file with 6PACK it will have this format:
Short description:
Stream magic + Chunk of metadata + N * Chunk of data
Each chunk contains header (16 bytes, see italic rows) + data (0+ bytes) / metadata (length of file name + 11 bytes)
This is an unsuitable format for Netty. Also FastLZ is not a very popular compression algorithm and it doesn't have a good Java library to create Java
Input/OutputStream
s (jfastlz can compress only files from your file system and uses command line for this). So I think that we may create our custom header format and use only compressor and decompressor from jfastlz. It may be something like LZF format:In addition, compressed chunks (type 0x01) will contain additional 2 header bytes:
And it will be more convenient to use Big Endian notation (6PACK uses Little Endian notation for chunk headers).
@trustin @normanmaurer WDYT?
The text was updated successfully, but these errors were encountered: