Python and STL efficiency
Ray
ray_usenet at yahoo.com
Tue Aug 22 04:37:56 EDT 2006
Tim N. van der Leeuw wrote:
> > In which case, Licheng, you should try using the /GF switch. This will
> > tell Microsoft C++ compiler to pool identical string literals together.
> >
> >
> > :)
>
> The code still creates a new string - instance each time it tries to
> append a const char* to the vector<string> ...
Yeah, you're right... I've been programming Java too long :)
> You should instead create the string-objects ahead of time, outside of
> the loop.
>
> Regards,
>
> --Tim
More information about the Python-list
mailing list