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
"Jon A. Lambert" wrote:
> But you have changed your requirements above from speed to memory.
> No fair. ;)
fragmented memory access == slow => memory == speed
> The alphabet trie above has some pros and cons:
>
> 1) avoids the overhead of string hashing
Uh? Hashing is most likely faster, unless you deliberately make it slow.
It isn't too difficult to come up with a reasonable hashing scheme for
small sets (without delete, or with lazy delete)
first hash =
RANDOMLUT[string[0]] +
RANDOMLUT[string[stringlength/2]+OFFSET1] +
RANDOMLUT[string[stringlength-1]+OFFSET2] + stringlength;
on collision, use a second hash, e.g. =
hash=stringlength;
switch(stringlength){
default: do whatever for string[8..stringlength]
case 8: hash += RANDOMLUT[string[7]+OFFSET10];
case 7: hash += RANDOMLUT[string[6]+OFFSET9];
case 6: hash += RANDOMLUT[string[5]+OFFSET8];
case 5: hash += RANDOMLUT[string[4]+OFFSET7];
case 4: hash += RANDOMLUT[string[3]+OFFSET6];
case 3: hash += RANDOMLUT[string[2]+OFFSET5];
case 2: hash += RANDOMLUT[string[1]+OFFSET4];
case 1: hash += RANDOMLUT[string[0]+OFFSET3];
}
> 2) provides intrinsic support for abbreviations
I don't think abbreviations is very good from a usability point of view,
it can lead to unexpected results. Besides, you can get that with hashing
too, just insert the substrings as well.
> 1) based on English and may not support blanks, puntuation, or other
> characters (of course this can be altered or enforced)
Easily for limited charsets using a translation table, which would be
handy because you could make it case insensitive at the same time.
N-ary tree example:
unsigned char table[256];
fill table with the value 0;
table['a']=table['A']=1;
...
table['z']=table['Z']=27;
table['æ']=table['Æ']=28;
table['ø']=table['Ø']=29;
table['å']=table['Å']=30;
struct node {
node *branches[31];
object *obj;
node(){ branches[0..31] = obj = NULL; }
};
object *findobj(const string &s,const node *n){
for(int i=0; i<s.length(); i++){
n = n->branches[table[s[i]]];
if(n==NULL) return NULL;
}
return n->obj;
}
object *findobj(const char *s,const node *n){
while(*s) {
n = n->branches[table[*s++]];
if(n==NULL) return NULL;
}
return n->obj;
}
I suspect you can make it faster for successfull hits with zero
terminated strings by making zero a symbol... (avoiding the n==NULL test,
which isn't too expensive anyways btw) Hmmm, could be fun to
implement... Would be useful as you could allow " ,.:;" to function as
string terminators as well. An advanced version could use multiple
translation tables and compress the N-ary tree nodes based on profiling
information.
Sketchy:
unsigned char emptytable[256] = {0,0,0,0,0...};
unsigned char terminatortable[256] = x in "\0 ,.:;" ? 1 : 0;
unsigned char smalltable[256] = terminatortable + alphas...
unsigned char largetable[256] = smalltable + rare characters
class node { public:
object *obj;
unsigned char *table;
node *branches[1]; //have to fake this size with malloc :-x
node(){obj=NULL; table=emptytable; branches[0]=&errornode; }
};
node emptynode = {NULL, emptytable, NULL};
node errnornode = {NULL, emptytable, emptynode};
findobj(s,n){
do {
m = n;
n = n->branches[n->table[*s]];
s++;
} while(n);
return m->obj;
}
Bwahahaha, I love hacks like these...
findobj(char *s,node *n){
s-=2;
do {
s+=2;
m = n->branches[n->table[s[0]]];
if(!m) return n->obj;
n = m->branches[m->table[s[1]]];
} while(n);
return m->obj;
}
:*)
Now if Raph could post all the names to all the players of Ultima Online
then we could see what actually would happen in a real life situation...
I guess one could use IRC as well. Hmm...
> The hash algorithm would treat the name string as either a 2 byte or 4 byte
> unsigned int which should be cheaper to hash than the entire string. Of
> course, you would have to enforce a mininum name length.
Why a minimum name length? All you need is to store the strings zero
padded up to the alignment boundary, which should not be too expensive as
you often end up with such alignments anyway.
Examples:
zeropad("hello") == 'hell','o\0\0\0'
zeorpad("hell") == 'hell', '\0\0\0\0'
zeropad("?") == '?\0\0\0'
The only trouble would be if you work with pointers directly into string
buffers. There are ways to compensate for this though. For a 32 bit
implementation: write 4 versions and use masking, and make stringlength<3
a special case as you risk to mask out on both ends... (and remember
safe-hex!)
Anyway, it is almost always faster to choose a data structure that only
supports the functionality one looks for. So really, it doesn't make any
sense to discuss this stuff without some more knowledge about what kind
of statistical properties, and operation sequences we are talking about.
--
Ola Fosheim Groestad,Norway http://www.stud.ifi.uio.no/~olag/
- 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
- Naming and Directories? Mark Gritter
- 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