[Clam-devel] TokenDelay patch

Sam Roig tzahm at punkass.com
Sat May 5 07:47:32 PDT 2007


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
>
>
>


-- 
::: sam :::




More information about the clam-devel mailing list