Re: Performance tweaks

From: Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Date: Fri Feb 25 2000 - 06:57:03 EST


Mitchell Blank Jr <mitch@sfgoth.com> said:
> Andrew Morton wrote:
> > For uniprocessors this:
> >
> > const int cpu = smp_processor_id();
> > if (dev->xmit_lock_owner != cpu) {
> >
> > generates faster code than this:
> >
> > int cpu = smp_processor_id();
> > if (dev->xmit_lock_owner != cpu) {

> That's really odd, I would have assumed that gcc would have optomized
> the variable away, but your experiment indicates otherwise.

What version of gcc? Optimizations have been improving steadily. It is
better to fix the compiler than to mess up the source to get it do do what
it should do. The gcc folks _are_ receptive to reports.

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:14 EST