JFFS3 & performance

Joakim Tjernlund Joakim.Tjernlund at lumentis.se
Thu Dec 16 16:06:21 EST 2004


> > unsigned short crc16 (unsigned char *buf, size_t len)
> > {
> >         unsigned short crc = 0xffff;
> >         while (len--)
> >                 crc = (unsigned short) (crc >> 8) ^ 
> > 		     crc16tab[(crc ^ (unsigned short)(*buf++)) & 0xff];
> >         return crc;
> > }
> > 
> 
> Thomas, you respond faster than I can think!
> 
> real    0m0.395s
> user    0m0.326s
> sys     0m0.067s
> 
> The algorithm doesn't run that fast, though.

There is still more one can do, look in lib/crc32.c in the kernel to see
what I mean. It is tricky to get everything right, but just unrolling it a bit will help.

 Jocke




More information about the linux-mtd mailing list