Python and STL efficiency

Tim N. van der Leeuw tim.leeuwvander at nl.unisys.com
Mon Aug 21 04:28:07 EDT 2006


Marc 'BlackJack' Rintsch wrote:
> In <1156143136.020647.294290 at i42g2000cwa.googlegroups.com>, Licheng Fang
> wrote:
>
> > Hi, I'm learning STL and I wrote some simple code to compare the
> > efficiency of python and STL.
> >
[...]
>
> There's a difference in data structures at least.  The Python `set` type
> is implemented with a hash algorithm, so the equivalent STL type would be
> `hash_set`.  `set` in Python does not store its contents sorted.
>

The set should be only 4 items in size, according to my reading of the
code, so set implementation differences shouldn't lead to drastic
performance differences.


> Ciao,
> 	Marc 'BlackJack' Rintsch

Cheers,

--Tim




More information about the Python-list mailing list