Bmax Hashtables!

BlitzMax Forums/BlitzMax Programming/Bmax Hashtables!

SculptureOfSoul(Posted 2007) [#1]
Alright, I just added my first entry to the code archives - a hashtable type for Bmax. The code is based on the core code provided by Defoc8, although with many improvements and additions.

I apologize for the ugly test/demonstration code, but I didn't have much time to tidy up the scrap code I wrote to test it.

Anyhow, you can find it here: http://www.blitzmax.com/codearcs/codearcs.php?code=1907


Perturbatio(Posted 2007) [#2]
Um... is there something wrong with TMap?


SculptureOfSoul(Posted 2007) [#3]
It's all about using the right data structure for the job. If you need to store say, 1000 key value pairs, a hash table will be much faster than a Map.


SculptureOfSoul(Posted 2007) [#4]
This hash table type also supports multiple entries per key, the ability to sort those entries on an overloaded compare method, along with some other neat features.

I optimized this for speed as it was going to be the core variable type for my mudserver (mimicking the table type in Lua such that I wouldn't need to shift all of my data over to Lua or pipe everything through that darned virtual stack.)