D performance guideline (request)

Robert Fraser fraserofthenight at gmail.com
Sun Apr 13 14:12:20 PDT 2008


Georg Wrede wrote:
> Robert Fraser wrote:
>> Robert Fraser wrote:
>>
>>> - Try using memory-efficient data structures like Judy (
>>>   http://judy.sourceforge.net/ ).
>>
>>
>> Or maybe not:
>>
>> http://www.nothings.org/computer/judy/
> 
> Well, the guy certainly saw a lot of effort trying to prove that Judy 
> isn't cool. I'm not impressed.
> 
> Especially the consistent performance of Judy_seq and Judy_64 was quite 
> amazing. If one wants predictable and scalable performance, that 
> additionally is excellent, then that is my choice. I assume that, if one 
> knows the data is in order, then Judy is good, and for unordered data 
> (i.e. that which really needs hashing) a hash is better. (Gee, surprise.)
> 
> So, it shows two things: Firstly, if you have a choice, then benchmark, 
> benchmark, and benchmark. Don't just read ads or believe the buzz on the 
> street. Second, every job has its tool.
> 
> IIUC, sparse arrays would be a dream application for Judy, especially if 
> they can be filled in order. Or partial order.

While I often do sequential inserts into an associative array, I rarely 
do sequential reads (Unless I'm enumerating through all the values). So, 
I guess every structure has its place, and Judy is much more 
memory-efficient. But that benchmark tells me "in common usage (where 
data is unordered), Judy is less efficient than a hash table".



More information about the Digitalmars-d mailing list