JFFS3 & performance
Jörn Engel
joern at wohnheim.fh-wedel.de
Thu Dec 16 15:46:26 EST 2004
On Thu, 16 December 2004 20:58:55 +0100, Joakim Tjernlund wrote:
> > crc24:
> > real 0m0.969s
> > user 0m0.882s
> > sys 0m0.073s
> >
> >
> > Looks like those cold hard numbers beat the crap out of my previous
> > argument. So unless someone can seriously optimize below functions,
> > just pick adler32.
>
> A table driven crc24/crc16 is faster, I think.
Sure. I'm just too lazy to create one. (hint, hint)
> > uint32_t crc24(uint32_t crc, const void *_s, size_t len)
> > {
> > const char *s = _s;
> > uint32_t ret = crc;
> > strlen(s);
>
> Why strlen()?
Leftover from my quick'n'dirty hacking. Numbers without the strlen:
real 0m0.952s
user 0m0.878s
sys 0m0.068s
Not a big difference.
>
> > for (; len; len--,s++) {
> > ret <<= 8;
> > ret += *s;
> > ret %= 0xfffffd;
> > }
> > return ret;
> > }
>
> This is probably faster(on PPC).
> Depens on gcc version as well.
>
> uint32_t crc24(uint32_t crc, const void *_s, size_t len)
> {
> const char *s = _s-1;
> uint32_t ret = crc;
> if (len)
> do {
> ret <<= 8;
> ret += *++s;
> ret %= 0xfffffd;
> } while (--len);
> return ret;
> }
Not in i386, though. So unless the tables really make a difference,
just don't bother.
real 0m0.954s
user 0m0.880s
sys 0m0.064s
Jörn
--
People will accept your ideas much more readily if you tell them
that Benjamin Franklin said it first.
-- unknown
More information about the linux-mtd
mailing list