Just another Perl shrine | |
PerlMonks |
Re: Re: More details on compressing a set of integersby toma (Vicar) |
on Jan 26, 2003 at 07:08 UTC ( [id://229953]=note: print w/replies, xml ) | Need Help?? |
Sorry, I should have mentioned that I didn't mean to
use the Base64 module, I was considering writing the
numbers in base 64, so that when I run out of 0-9 I
go through a-z then A-Z, etc, so I use more of the
bits of the characters, and use fewer digits to
represent the same number. The penalty for compression on small strings is the dictionary that gets set up for the string. If I use a fixed dictionary, this shouldn't be a problem. So I need a customized version of the compression code. With compression, I shouldn't need to use base 64, and I'm guessing that I will get about a 60% reduction in size. Another optimization I thought of was to change the numbers to represent the differences between the numbers instead of the numbers themselves. So instead of I would have
It should work perfectly the first time! - toma
In Section
Seekers of Perl Wisdom
|
|