in reply to How to use Compress::LZV1
According to the Compress::LZV1 docs:
Try to compress the given string as quickly and as much as possible. In the worst case, the string can enlarge by at most a single byte. Empty strings yield empty strings. The uncompressed data string must be smaller than 16MB (1<<24).(my emphasis added)
The module is indeed "compressing" your data, as can bee seen by the U at the start of the compressed string.
From what I remember, LZV-type compression is a dictionary-based algorithm. Without getting too deep into compression, this means that a dictionary is used to map out "compressable" portions of the message. This dictionary takes up a certain amount of space (say, 100 bytes). If the size of the data to compress is already smaller than the size of the dictionary, actually compressing the data will give a net increase in the size; not what you wanted. The implimentation of the algorithm used in the Compress::LZV1 package is smart enough to realize this fact and stores the string with a flag denoting that the string is uncompressed. This gives a net increase of one byte to the data, which is definately better than adding 100 bytes to the message.
You're not doing anything wrong, as far as I can tell, other than using too small of a bit of data. Try increasing the amount of data you're using and see if that helps.
|
---|