Well, I'm going to tidy up the code a bit and post it later. I'm not using it right now and if someone else finds some use for it all the better.
Regarding the speed: hehe, yeah, it's amazing what a computer can do. It's also amazing what kind of impact little optimizations can make. Hand-rolling a for loop instead of calling for-eachin shaved off ~200 or so millisecs from the above # of operations. While that's really rather trivial in the scheme of things, I was going to be doing tons of lookups per frame (every character in the MUD was a big hash-table of data, basically, so that I could add variables, add hooks to "logic modules", etc etc.) so I needed the utmost speed. I used Lua as a benchmark since it's fundamental variable type, the table, is based on hash tables and is highly optimized.
Hope to have the code up and in the archives within a few hours.
Regarding the speed: hehe, yeah, it's amazing what a computer can do. It's also amazing what kind of impact little optimizations can make. Hand-rolling a for loop instead of calling for-eachin shaved off ~200 or so millisecs from the above # of operations. While that's really rather trivial in the scheme of things, I was going to be doing tons of lookups per frame (every character in the MUD was a big hash-table of data, basically, so that I could add variables, add hooks to "logic modules", etc etc.) so I needed the utmost speed. I used Lua as a benchmark since it's fundamental variable type, the table, is based on hash tables and is highly optimized.
Hope to have the code up and in the archives within a few hours.