Re: kernel optimization

From: cutaway
Date: Sat Jul 23 2005 - 01:32:06 EST


----- Original Message -----
From: "Adrian Bunk" <bunk@xxxxxxxxx>
To: "christos gentsis" <christos_gentsis@xxxxxxxxxxx>
Cc: <linux-kernel@xxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/