What wrong did i do? (key in hashtable is always null)

The Anh Tran trtheanh at gmail.com
Thu Dec 31 07:51:29 PST 2009

bearophile wrote:
> This was my version, maybe it solves some of your problems:
> http://shootout.alioth.debian.org/debian/benchmark.php?test=knucleotide&lang=gdc&id=2
> I haven't used my dlibs here, so for example that sort in the middle is long and ugly (and not fully correct, that opCmp doesn't compare accordingly both key and value, as the problem specs state: "sorted by descending frequency and then ascending k-nucleotide key"), in Python it becomes:
> l = sorted(frequences.items(), reverse=True, key=lambda (seq,freq): (freq,seq))
> With my dlibs it's similar. You can probably do something similar with Phobos2.
> By the way, the formatting of your code needs improvements, reduce indentation length and format code in a more readable way.
> Bye,
> bearophile

Thanks for pointing out code format style. :)
Shootout site stop benching D lang => why wasting time in formating code 
for someone else.

I just curious in D's AA perf compared to C++ pb_ds::cc_hash_table. The 
newest C++ knucleotide using uint64 as key, not char[] anymore.

In my small test case, D's built-in AA has the same perf as C glib. 
That's 4-5 times slower that pb_ds::cc_hash_table. Moreover, i think 
that it has bug -.-

More information about the Digitalmars-d-learn mailing list