Messages in this thread | | | From | <> | Subject | Re: kernel optimization | Date | Sat, 23 Jul 2005 02:30:31 -0400 |
| |
----- 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/
| |