RE: JFFS3 & performance

Joakim Tjernlund
2004-12-16T21:06:30Z

> > 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