March 1999
- Storytelling vs simulation, Koster, Raph
- Storytelling vs simulation, Eli Stevens {KiZurich}
- Storytelling vs simulation, Mik Clarke
- Storytelling vs simulation, J C Lawrence
- Storytelling vs simulation, Matthew Mihaly
- Storytelling vs simulation, J C Lawrence
- Storytelling vs simulation, Matthew Mihaly
- Storytelling vs simulation, Caliban Tiresias Darklock
- OT: MUSH semantics (was: Influential muds) T. Alexander Popiel
- Storytelling and Gods (fairly long) Matthew Mihaly
- Storytelling and Gods (fairly long) Koster, Raph
- Storytelling and Gods (fairly long) Matthew Mihaly
- Generic event handling Adam Wiggins
- How to support 1000+ simultaneous connections, and some philosophy. Ben Greear
- How to support 1000+ simultaneous connections, and some philosophy. Matthew D. Fuller
- How to support 1000+ simultaneous connections, and some philosophy. Chris Gray
- How to support 1000+ simultaneous connections, and some philosophy. Chris Gray
- How to support 1000+ simultaneous connections, and some philosophy. Caliban Tiresias Darklock
- How to support 1000+ simultaneous connections, and some philosophy. Nathan F Yospe
- How to support 1000+ simultaneous connections, and some philosophy. Caliban Tiresias Darklock
- How to support 1000+ simultaneous connections, and some philosophy. Jason Spangler
- How to support 1000+ simultaneous connections, and some philosophy. Oliver Jowett
- How to support 1000+ simultaneous connections, and some philosophy. Oliver Jowett
- How to support 1000+ simultaneous connections, and some philosophy. Chris Gray
- How to support 1000+ simultaneous connections, and some philosophy. Caliban Tiresias Darklock
- How to support 1000+ simultaneous connections, and some philosophy. Chris Gray
- How to support 1000+ simultaneous connections, and some philosophy. Petri Virkkula
- How to support 1000+ simultaneous connections, and some philosophy. Chris Gray
- How to support 1000+ simultaneous connections, and some philosophy. Petri Virkkula
- How to support 1000+ simultaneous connections, and some philosophy. J C Lawrence
- How to support 1000+ simultaneous connections, and some philosophy. Petri Virkkula
- ADMIN: Kanga.Nu outage and other news -- please read J C Lawrence
- Elder Games Martin C Sweitzer
- Elder Games Adam Wiggins
- Elder Games Koster, Raph
- Elder Games Matthew Mihaly
- Elder Games Caliban Tiresias Darklock
- Elder Games Martin C Sweitzer
- Elder Games Matthew Mihaly
- Elder Games Kylotan
- Elder Games Caliban Tiresias Darklock
- Elder Games Kylotan
- Elder Games Koster, Raph
- Elder Games B. Scott Boding
- Elder Games Wes Connell
- Elder Games Caliban Tiresias Darklock
- Elder Games Matthew D. Fuller
- Elder Games B. Scott Boding
- Elder Games Michael Hohensee
- Elder Games Matthew Mihaly
- Elder Games Benjamin D. Wiechel
- Elder Games Chris Gray
- Elder Games Chris Gray
- Elder Games J C Lawrence
- Elder Games Nathan F Yospe
- Elder Games J C Lawrence
- Multiple clients (was How to support 1000+ simultaneous connections) Matthew D. Fuller
- Multiple clients (was How to support 1000+ simultaneous connections) Chris Gray
- Naming and Directories? Mark Gritter
- Naming and Directories? Matthew D. Fuller
- Naming and Directories? Adam Wiggins
- Naming and Directories? Hans-Henrik Staerfeldt
- Naming and Directories? Chris Gray
- Naming and Directories? Mark Gritter
- Naming and Directories? Mik Clarke
- Naming and Directories? Mark Gritter
- Naming and Directories? Nathan F Yospe
- Naming and Directories? Ola Fosheim Grøstad
- Naming and Directories? Nathan F Yospe
- Naming and Directories? Mik Clarke
- Naming and Directories? Mark Gritter
- Naming and Directories? Jon A. Lambert
- Naming and Directories? Hans-Henrik Staerfeldt
- Naming and Directories? Ola Fosheim Grøstad
- Naming and Directories? Chris Gray
- Naming and Directories? Caliban Tiresias Darklock
- Naming and Directories? Ben Greear
- Naming and Directories? Mik Clarke
- Naming and Directories? Chris Gray
- Naming and Directories? Chris Gray
- Naming and Directories? Chris Gray
- Naming and Directories? Jo Dillon
- Naming and Directories? J C Lawrence
- Naming and Directories? Mark Gritter
- Naming and Directories? Ola Fosheim Grøstad
Mark Gritter wrote:
>
> Ola Fosheim =?iso-8859-1?Q?Grøstad?= 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.)
Uhm... But a hashtable would only access like... 3-5 cachelines? (I
don't think trees and tries qualifies as random-access structures
either) The benefit of the binary tree is that it is efficient to
traverse... So we agree, we need to know what the datastructure is going
to be used for. For instance, if you want to display a sorted "all
players" list then a binary tree (or a balancing variant) would do ok.
*shrug*
> 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;
> };
sizeof(struct node) == 36... Maybe it would be better if one clustered
those variables whose bytes are most likely to be accessed? ;^)
struct node {
struct node *left, *right;
char key[ANY_LENGTH]; // will usually only access the first few bytes
object *obj; // almost never accessed
}
Of course, if you keep thinking like this then you will never get a MUD
up and running ;) With 1000 names then you would only access about 10
nodes (cachelines) per lookup.. Not too bad?
Another option would be to only store the first 4 bytes in the node, and
revert to the object itself if there is a match (sizeof(node)= :).
Sketch:
struct node {struct node *l,*r; uint32 key; object *obj;}
object *findobj(char *key,node *n){
uint32 k; int i=0;
do{k<<=8;k|=key[i++];}while((i&3)&&(!(k&255)));
if(i||(!key[4])){ //strlen(key)<=4
i=4-i;while(i--)k<<=8;
do{
if(k<n->key){n=n->l; continue;}
if(k>n->key){n=n->r; continue;}
return n->obj;
}while(n);
return NULL;
}
do{
if(k<n->key){n=n->l; continue;}
if(k>n->key){n=n->r; continue;}
i=strcmp(key+4,n->obj->key+4);
if(i<0){n=n->l; continue;} //is this right??
if(i>0){n=n->r; continue;}
return n->obj;
}while(n);
return NULL;
}
Don't complain about readability! :)
Oh yeah, while we are at it, why not limit names to 12 characters and
allow only 30 unique symbols (0 used for padding, 1 used for illegal
characters), then we could bitcompress it and fit the key in 60 bits...
Would be nice for client-server protocols as well...
inline long long convert(char *s){
long long k=0;int i=0;
do{
k<<=5;
k|=translationtable[s[i++]];
if(!(k&0x1e)){
if(k&1) throw "illegal character";
i-i;
return k<<((i<<2)+i);
}
}while(i<12);
if(!s[12])throw "string too long";
return k;
}
object* findobj(char *key,node *n){
long long k=convert(key);
for(;;){
if(k<n->key){n=n->l; if(n)continue; return 0;}
if(k>n->key){n=n->r; if(n)continue; return 0;}
return n->obj;
}
assert(1);
}
I don't think this would be too slow? Hmm.. I might use that...
--
Ola Fosheim Groestad,Norway http://www.stud.ifi.uio.no/~olag/ - Naming and Directories? Mark Gritter
- Naming and Directories? Ola Fosheim Grøstad
- Naming and Directories? Ola Fosheim Grøstad
- Naming and Directories? Chris Gray
- Naming and Directories? J C Lawrence
- Naming and Directories? Jo Dillon
- Naming and Directories? Jay Carlson
- Naming and Directories? Jon A. Lambert
- Naming and Directories? Ola Fosheim Grøstad
- Naming and Directories? J C Lawrence
- Naming and Directories? Ola Fosheim Grøstad
- Balancing a Mud Martin C Sweitzer
- Balancing a Mud Neerenberg, AaronX
- Balancing a Mud Mik Clarke
- Balancing a Mud Martin C Sweitzer
- Multiple clients (was How to support 1000+ simultaneous connec Marc Bowden
- ADMIN: Signature length J C Lawrence
- distributed, _untrusted_ servers Oliver Jowett
- OT ADMIN: Web links to MUD-Dev J C Lawrence
- (fwd) MUD Economies J C Lawrence
- (fwd) MUD Economies J C Lawrence
- (fwd) MUD Economies J C Lawrence
- (fwd) MUD Economies J C Lawrence
- Potential New Laws Benjamin D. Wiechel
- Mud Economies (A simple idea) Wes Connell
- Self-organizing worlds (was: Elder Games) B. Scott Boding
- Self-organizing worlds (was: Elder Games) Mik Clarke
- Self-organizing worlds (was: Elder Games) Koster, Raph
- Self-organizing worlds (was: Elder Games) Nicholas Lee
- Self-organizing worlds (was: Elder Games) Koster, Raph
- Self-organizing worlds (was: Elder Games) B. Scott Boding
- Self-organizing worlds (was: Elder Games) Nicholas Lee
- Self-organizing worlds (was: Elder Games) Ola Fosheim Grøstad
- Self-organizing worlds (was: Elder Games) Martin Keegan
- Self-organizing worlds (was: Elder Games) Ola Fosheim Grøstad
- Self-organizing worlds (was: Elder Games) Nicholas Lee
- Mass Creation OLC Functions (idea from Elder Games) Wes Connell
- Mass Creation OLC Functions (idea from Elder Games) Matthew Mihaly
- Mass Creation OLC Functions (idea from Elder Games) Nathan F Yospe
- Mass Creation OLC Functions (idea from Elder Games) Matthew Mihaly
- Mass Creation OLC Functions (idea from Elder Games) Nathan F Yospe
- Mass Creation OLC Functions (idea from Elder Games) Ola Fosheim Grøstad
- Mass Creation OLC Functions (idea from Elder Games) Nathan F Yospe
- Mass Creation OLC Functions (idea from Elder Games) Ola Fosheim Grøstad
- Mass Creation OLC Functions (idea from Elder Games) Brandon A Downey
- Mass Creation OLC Functions (idea from Elder Games) Adam Wiggins
- Mass Creation OLC Functions (idea from Elder Games) Martin C Sweitzer
- Mass Creation OLC Functions (idea from Elder Games) Quzah [softhome]
- Mass Creation OLC Functions (idea from Elder Games) Richard Woolcock
- Mass Creation OLC Functions (idea from Elder Games) Chris Gray
- Mass Creation OLC Functions (idea from Elder Games) J C Lawrence
- Mass Creation OLC Functions (idea from Elder Games) Christopher Allen
- Mass Creation OLC Functions (idea from Elder Games) Matthew Mihaly
- Mass Creation OLC Functions (idea from Elder Games) Chris Gray
- Mass Creation OLC Functions (idea from Elder Games) J C Lawrence
- Mass Creation OLC Functions (idea from Elder Games) J C Lawrence
- On the topic of Mud AI Leif Hardison
- On the topic of Mud AI Nicholas Lee
- On the topic of Mud AI Andrew Norman
- Unicode, ascii and names Ola Fosheim Grøstad
- Variable-sized structures in C (was: Naming and Directories) T. Alexander Popiel
- Variable-sized structures in C (was: Naming and Directories) Ola Fosheim Grøstad
- Renaming objects. John Hopson
- Renaming objects. David Bennett
- Variable-sized structures in C (was: Naming and Directories) Petri Virkkula
- Self-organizing worlds (was: Elder Games) Koster, Raph
- Self-organizing worlds (was: Elder Games) Ola Fosheim Grøstad
- online economy behavior (was: Self-organizing worlds) Robert Green
- online economy behavior (was: Self-organizing worlds) Matthew Mihaly
- online economy behavior (was: Self-organizing worlds) Adam Wiggins
- online economy behavior (was: Self-organizing worlds) Robert Green
- online economy behavior (was: Self-organizing worlds) Matthew Mihaly
- online economy behavior (was: Self-organizing worlds) Matthew Mihaly
- online economy behavior (was: Self-organizing worlds) Christopher Allen
- Self-organizing worlds (was: Elder Games) Koster, Raph
- Self-organizing worlds (was: Elder Games) Koster, Raph
- Self-organizing worlds (was: Elder Games) Chris Gray
- Self-organizing worlds (was: Elder Games) Benjamin D. Wiechel
- Self-organizing worlds (was: Elder Games) Mik Clarke
- online economy behavior (was: Self-organizing worlds) Chris Gray
- OT: just a little something... Ola Fosheim Grøstad
- (fwd) implications J C Lawrence
- Downtime J C Lawrence
- Getting Started with Mud Server Stormblade
- Getting Started with Mud Server Ross Nicoll
- Getting Started with Mud Server Jim Clark
- Getting Started with Mud Server Ben Greear
- Getting Started with Mud Server Chris Gray
- Getting Started with Mud Server Jo Dillon
- Getting Started with Mud Server Hans-Henrik Staerfeldt
- Terms Ola Fosheim Grøstad