From: Andi Kleen <ak@suse.de>
To: Simon Lodal <simonl@parknet.dk>
Cc: Patrick McHardy <kaber@trash.net>,
netdev@vger.kernel.org, lartc@mailman.ds9a.nl
Subject: Re: [PATCH] HTB O(1) class lookup
Date: 01 Feb 2007 12:30:47 +0100 [thread overview]
Message-ID: <p73r6tanmhk.fsf@bingen.suse.de> (raw)
In-Reply-To: <200702010808.20416.simonl@parknet.dk>
Simon Lodal <simonl@parknet.dk> writes:
>
> Memory is generally not an issue, but CPU is, and you can not beat the CPU
> efficiency of plain array lookup (always faster, and constant time).
Actually that's not true when the array doesn't fit in cache.
The cost of going out to memory over caches is so large (factor 100 and more)
that often algorithms with smaller cache footprint can easily beat
algorithms that execute much less instructions if it has less cache misses.
That is because not all instructions have the same cost; anything
in core is very fast but going out to memory is very slow.
That said I think I agree with your analysis that a two level
array is probably the right data structure for this and likely
not less cache efficient than the hash table.
And the worst memory consumption case considered by Patrick should
be relatively unlikely.
-Andi
next prev parent reply other threads:[~2007-02-01 10:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-01 5:18 [PATCH] HTB O(1) class lookup Simon Lodal
2007-02-01 6:08 ` Patrick McHardy
2007-02-01 7:08 ` Simon Lodal
2007-02-01 11:30 ` Andi Kleen [this message]
2007-02-05 10:16 ` Jarek Poplawski
2007-02-05 11:24 ` Andi Kleen
2007-02-05 12:45 ` Ingo Oeser
2007-02-05 17:14 ` Simon Lodal
2007-02-06 8:08 ` Jarek Poplawski
2007-02-08 7:36 ` Jarek Poplawski
2007-02-05 18:21 ` Simon Lodal
2007-02-01 13:06 ` jamal
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=p73r6tanmhk.fsf@bingen.suse.de \
--to=ak@suse.de \
--cc=kaber@trash.net \
--cc=lartc@mailman.ds9a.nl \
--cc=netdev@vger.kernel.org \
--cc=simonl@parknet.dk \
/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;
as well as URLs for NNTP newsgroup(s).