[Samba] [RESEND] crc32 optimization

Joakim Tjernlund joakim.tjernlund at lumentis.se
Tue May 27 14:17:47 GMT 2003


> On Tue, 2003-05-27 at 20:42, Joakim Tjernlund wrote:
> > Hi Samba
> > 
> > I noticed that the crc32 function in lib/crc32.c is somewhat
> > inefficient. This little patch will reduce the inner loop from 10
> > instructions to 8 instructions on x86 with gcc. gcc can't figure
> > out this simple optimization by itself on x86.
> 
> So, we are saving two instructions...  I think this e-mail consumed more
> ;-)

Sure, but this little fix may increase performance by 10-20% :)
> 
> > Further optimization is possible by using the impl. in the linux 2.5 kernel, but
> > I don't know if it is worth it. Is crc32 common in samba? What would the typical
> > buffer len be?
> 
> It's reasonably rare.  It's certainly not in any fast-paths that I know
> of.

OK then I won't bother with any further crc32 optimizations, thanks.

 Jocke

PS.
   I would very much appreciate if you could offer any advice for the problem
   I have, see http://lists.samba.org/pipermail/samba/2003-May/096336.html
   for details.




More information about the samba mailing list