To begin in D coming from Python
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Jul 21 06:59:49 PDT 2008
"bearophile" <bearophileHUGS at lycos.com> wrote in message
news:g621m4$2j6a$1 at digitalmars.com...
> - CPython is written in C, so C is much better integrated with Python than
> D.
Uh -- Pyd?
> int[string] aa;
> aa["hello".dup] = 10;
> etc.
I don't know why you're .dupping there.
> Note that in many situations Python dicts are faster or much faster than D
> associative arrays. So in speed-critical points of your code you may have
> to invent creative ways to avoid using them, like using arrays of bools to
> represent the set, using enums, using sorted arrays with a binary search,
> etc. Often what's slow in D is fast in Python and vice versa (but very
> often what's fast in D is fast in Psyco too).
Or, you know, use another hash implementation. Like Tango's HashMap, which
is consistently faster than the built-in AAs. Or write your own.
More information about the Digitalmars-d
mailing list