develooper Front page | perl.perl6.porters | Postings from May 2000

RE: Simplfied vector<> ?

Thread Previous | Thread Next
From:
Moore, Paul
Date:
May 2, 2000 01:20
Subject:
RE: Simplfied vector<> ?
Message ID:
714DFA46B9BBD0119CD000805FC1F53BDC3AD0@UKRUX002.rundc.uk.origin-it.com
From: Chip Salzenberg [mailto:chip@valinux.com]
> 
> The standard C++ vector<> container is almost perfect for use in Perl
> arrays and the data stack.  But it has a major weakness...  It's _so_
> general that it doesn't use memcpy() [or moral equivalent] when it has
> to grow.  Instead, it uses copy constructors in a loop.  That could be
> a major performance issue with vector<Counted_p<T>>.
> 
> Now, I could write a vector<> -- it's not that hard, as C++ goes --
> but I'm wondering if anyone has a lead on such a thing already, and/or
> library(ies) of such handy classes.

I don't know if/how such details are or should be handled, but you might
want to take a look at boost (www.boost.org) or ask on the boost mailing
list (boost@egroups.com). The people there have done a lot of work on
extensions to the STL classes, and may have what you want (I recall
something about a fast allocator, which may help performance of the standard
containers - if not, I'm sure there are people on the list who would be
interested in thrashing out performance issues like this).

On a related note, boost already has a counted pointer class, and they are
working hard on efficiency issues for it, so that may be worth a look, too.

Paul.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About