lkml.org 
[lkml]   [2006]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] ehea: interface to network stack
On Sat, 12 August 2006 06:56:24 +1000, Anton Blanchard wrote:
>
> > +
> > + skb_index = ((index - i
> > + + port_res->skb_arr_sq_len)
> > + % port_res->skb_arr_sq_len);
>
> This is going to force an expensive divide. Its much better to change
> this to the simpler and quicker:
>
> i++;
> if (i > max)
> i = 0;

Is a conditional cheaper than a divide? In case of a misprediction I
would assume it to be significantly slower and I don't know the ratio
of mispredictions for this branch.

Jörn

--
Victory in war is not repetitious.
-- Sun Tzu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-14 13:29    [W:0.160 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site