From: <cutaway@bellsouth.net>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: "Adrian Bunk" <bunk@stusta.de>, <linux-kernel@vger.kernel.org>
Subject: Re: kernel optimization
Date: Sat, 23 Jul 2005 18:03:02 -0400 [thread overview]
Message-ID: <00d501c58fd2$50d11130$2800000a@pc365dualp2> (raw)
In-Reply-To: <1122148237.27629.1.camel@localhost.localdomain>
I submit that sparse switch jump table's are not an "unusual" construct in
the Linux kernel/drivers. GCC only creates a table large enough to cover
the largest of the sparse values - it doesn't have to be 0...255. 0...60
with 10 values sparsely scattered would generate a 61 element jump table.
There's many K of locked memory in these sparse jump tables. About 2K worth
in the VT102 code alone.
----- Original Message -----
From: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
To: <cutaway@bellsouth.net>
Cc: "Adrian Bunk" <bunk@stusta.de>; <linux-kernel@vger.kernel.org>
Sent: Saturday, July 23, 2005 15:50
Subject: Re: kernel optimization
> On Sad, 2005-07-23 at 02:30 -0400, cutaway@bellsouth.net wrote:
> > Larger does not always mean slower. If it did, nobody would implement a
> > loop unrolling optimization.
>
> Generally speaking nowdays it does. Almost all loop unrolls are a loss
> on PIV.
>
> > 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.
>
> You are comparing with very expensive jump operations its an unusual
> case. For the majority of situations the TLB/cache overhead of misses
> vastly outweighs the odd clock cycle gained by verbose output.
>
>
next prev parent reply other threads:[~2005-07-23 22:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 18:55 christos gentsis
2005-07-22 19:52 ` David Lang
2005-07-22 20:15 ` Adrian Bunk
2005-07-22 20:14 ` Adrian Bunk
2005-07-22 21:11 ` christos gentsis
2005-07-23 14:34 ` Simon Strandman
2005-07-23 5:35 ` Al Boldi
2005-07-23 6:30 ` cutaway
2005-07-23 19:50 ` Alan Cox
2005-07-23 22:03 ` cutaway [this message]
[not found] <200507231849.j6NInMPO003728@laptop11.inf.utfsm.cl>
2005-07-26 5:22 ` Al Boldi
2005-07-26 9:22 ` Adrian Bunk
2005-07-27 3:53 Al Boldi
2005-07-27 4:20 ` Lee Revell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00d501c58fd2$50d11130$2800000a@pc365dualp2' \
--to=cutaway@bellsouth.net \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bunk@stusta.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®