[Clam-devel] TokenDelay patch

David García Garzón dgarcia at iua.upf.edu
Sat May 5 17:54:37 PDT 2007


That's what we did originally, Sam, but according Xavi's profiles the reserve 
didn't work as intended, at least on windows stl.


On Dissabte 05 Maig 2007, Sam Roig wrote:
> yes.
>
> why not use an stl vector insted and call reserve() to make sure the
> final vector will have enough capacity for whatever your are pushing
> on to it?
>
> then push_back() will only resize if the capacity needed wasn't reserved
> first.
>
> On 4/21/07, David García Garzón <dgarcia at iua.upf.edu> wrote:
> > On Divendres 20 Abril 2007, Xavier Amatriain wrote:
> > > On Fri, 2007-04-20 at 19:51 +0200, Pau Arumi wrote:
> > > > This can't break anything, ho ahead, commit it. We can improve it
> > > > later. Like leaving only one representation and get rid of
> > > > #ifdefs
> > >
> > > Will do..
> > >
> > > > However, I don't see what operations are more efficient using a
> > > > vector. Can you explain?
> > > > As I see it, when you copy, say, an spectrum its buffers are
> > > > copied in both cases.
> > >
> > > It's not about the copy, which does exist in both cases, but about the
> > > rellocation of memory. Every time you do a push or a pop, the queue
> > > resizes itself... or so does my profiler say ;)
> >
> > uau! thats an ugly backstab from the STL, I think we did a preallocation
> > to avoid this, but it wasn't working. Anyway, why a CLAM::Array instead
> > of a std::vector ;-)
> >
> > --
> > David García Garzón
> > (Work) dgarcia at iua dot upf anotherdot es
> > http://www.iua.upf.edu/~dgarcia
> >
> > _______________________________________________
> > Clam-devel mailing list
> > Clam-devel at llistes.projectes.lafarga.org
> > https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel



-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070506/ffd82269/attachment-0003.pgp>


More information about the clam-devel mailing list