lkml.org 
[lkml]   [2003]   [Apr]   [19]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
Date19 Apr 2003 13:45:00 +0200
From(Kai Henningsen)
SubjectRe: [TRIVIAL] kstrdup
root@chaos.analogic.com (Richard B. Johnson)  wrote on 18.04.03 in <Pine.LNX.4.53.0304181512220.22901@chaos>:

> The test for every byte transferred is, quite obviously, correct.
> It is also, quite obviously, non optimum.

Actually, that is very much not obvious.

Especially if you're familiar with architectures where every move has an  
implicit test (typically for zero and sign), and so checking for the zero  
byte during the move is quite obviously the only sane thing to do - the  
version with a count is slower, because the inner loop does more. (Those  
architectures typically don't have a REP-style prefix.)

MfG Kai
-
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 12:34    [W:0.114 / U:0.080 seconds]
©2003-2008 Jasper Spaans