lkml.org 
[lkml]   [2005]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: kernel optimization
Date
----- Original Message ----- 
From: "Adrian Bunk" <bunk@stusta.de>
To: "christos gentsis" <christos_gentsis@yahoo.co.uk>
Cc: <linux-kernel@vger.kernel.org>
Sent: Friday, July 22, 2005 16:14
Subject: Re: kernel optimization
>
> It's completely untested.
> And since it's larger, it's also slower.

Larger does not always mean slower. If it did, nobody would implement a
loop unrolling optimization.

ex. Look at how GCC generates jump tables for switch() when there's about
10-12 (or more) case's sparsely scattered in the rage from 0 through 255.
It generates a 256 element directly indexed jump table (obviously with many
duplicate entries). This is faster than a cascaded if/else
construct(particularly for those that would have been on the end of the
if/else chain), but it is a very large construct. You'll see some of these
"plump" switches generated in various SCSI drivers and in the VT102
emulation if you disassemble them.


-
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-07-23 08:33    [W:0.051 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site