lkml.org 
[lkml]   [2004]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC, 2.6] a simple FIFO implementation

> I did a similar test once for ppc that found that an increment followed by
> a test (marked unlikely) was actually quicker in practice than modulo
> arithmetic. The branch predictor got it right most of the time, so the
> test was almost free.

Yep x % y where y isnt constant could result in a divide which will blow
away 60+ cycles on some ppc machines. You can do a whole lot in those 60
cycles. Many memcpys for example :)

We removed all modulo arithmetic in the e1000 driver (replaced it with
if (x > y) x = 0) and managed to measure an improvement.
Anton
-
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: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans