msg00638.html
1999Q1/msg00638.html · 8.0 KB
From the archive 1999Q1.zip
Download the archive « Back to the archive contents
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD-Dev] Naming and Directories? -->
<!--X-From-R13: [nex Uevggre <znexNreqbf.Egnasbeq.SRG> -->
<!--X-Date: Wed, 17 Mar 1999 10:03:36 -0800 -->
<!--X-Message-Id: 199903180154.RAA24471#erdos,Stanford.EDU -->
<!--X-Content-Type: text -->
<!--X-Reference: 36EFD828.9059B5D#ifi,uio.no -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Naming and Directories?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:mark#erdos,Stanford.EDU">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">
<font size="+4" color="#804040">
<strong><em>MUD-Dev<br>mailing list archive</em></strong>
</font>
<br>
[ <a href="../">Other Periods</a>
| <a href="../../">Other mailing lists</a>
| <a href="/search.php3">Search</a>
]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->
Date:
[ <a href="msg00637.html">Previous</a>
| <a href="msg00639.html">Next</a>
]
Thread:
[ <a href="msg00628.html">Previous</a>
| <a href="msg00652.html">Next</a>
]
Index:
[ <A HREF="author.html#00638">Author</A>
| <A HREF="#00638">Date</A>
| <A HREF="thread.html#00638">Thread</A>
]
<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Naming and Directories?</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Naming and Directories?</LI>
<LI><em>From</em>: Mark Gritter <<A HREF="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</A>></LI>
<LI><em>Date</em>: Wed, 17 Mar 1999 17:54:49 -0800 (PST)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Ola Fosheim =?iso-8859-1?Q?Gr=F8stad?= writes:
>
> "Jon A. Lambert" wrote:
> > But you have changed your requirements above from speed to memory.
> > No fair. ;)
>
> fragmented memory access == slow => memory == speed
>
True. But almost _any_ large-scale random-access data structure is gonna
have bad memory locality, so in general, the fewer accesses, the better.
I and a couple of my research group members were talking about this, this
afternoon.
Although a trie could easily use 10x or more memory than a binary tree,
the number of cache lines you're accessing is likely to be much smaller
during a lookup, and that's generally a big win. (Assuming you have enough
memory so you don't have to page, of course.)
The "natural" binary tree repesentation
struct node {
char *key;
struct node *left, *right;
}
suffers from having to access _two_ cache lines per node: one for the
node itself and one to compare the key. A trie only accesses the cache
line containing the next-node pointer, so the large nodes don't hurt...
in the short term.
Binary-tree cache behavior could be improved significantly by limiting the
key length and adding some space overhead to the node:
struct node {
char key[24];
struct node *left, *right;
};
If your processor has 32-byte entries in its first-level cache, this will
probably be faster due to accessing only a single cache line per node.
I'd guess (without running a test) that not being able to share nodes
in a cache line isn't enough of a win to favor the former case.
The interesting question is what effect tries and the various flavors of
binary trees have on second-level cache behavior, and that's a lot harder
to model. Modern architectures make everything so complicated. :(
I'll agree that we're pretty much all blowing smoke without a specific
application/dataset in mind, Ola. :)
Mark Gritter
mgritter#cs,stanford.edu
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
<A HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>
</PRE>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00652" HREF="msg00652.html">Re: [MUD-Dev] Naming and Directories?</A></strong>
<ul compact><li><em>From:</em> Ola Fosheim Grøstad <olag#ifi,uio.no></li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00628" HREF="msg00628.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
<UL><LI><EM>From:</EM> Ola Fosheim Grøstad <olag#ifi,uio.no></LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00637.html">Re: [MUD-Dev] Mass Creation OLC Functions (idea from Elder Games)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00639.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00628.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00652.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00638"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00638"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Naming and Directories?</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00613" HREF="msg00613.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Tue 16 Mar 1999, 13:46 GMT
</LI>
<LI><strong><A NAME="00625" HREF="msg00625.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Wed 17 Mar 1999, 00:54 GMT
<UL>
<LI><strong><A NAME="00626" HREF="msg00626.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Hans-Henrik Staerfeldt <a href="mailto:hhs#cbs,dtu.dk">hhs#cbs,dtu.dk</a>, Wed 17 Mar 1999, 02:48 GMT
</LI>
<LI><strong><A NAME="00628" HREF="msg00628.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Wed 17 Mar 1999, 08:43 GMT
<UL>
<LI><strong><A NAME="00638" HREF="msg00638.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Wed 17 Mar 1999, 18:03 GMT
<UL>
<LI><strong><A NAME="00652" HREF="msg00652.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Thu 18 Mar 1999, 17:54 GMT
<UL>
<LI><strong><A NAME="00656" HREF="msg00656.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Thu 18 Mar 1999, 18:58 GMT
<LI><strong><A NAME="00662" HREF="msg00662.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Sat 20 Mar 1999, 16:15 GMT
</LI>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00644" HREF="msg00644.html">Re: [MUD-Dev] Naming and Directories?</A></strong>,
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 18 Mar 1999, 07:44 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
</LI>
</UL></BLOCKQUOTE>
</ul>
<hr>
<center>
[ <a href="../">Other Periods</a>
| <a href="../../">Other mailing lists</a>
| <a href="/search.php3">Search</a>
]
</center>
<hr>
</body>
</html>