[Clam-devel] TokenDelay patch

Pau Arumi parumi at iua.upf.edu
Sat Apr 21 13:46:21 PDT 2007


En/na David García Garzón ha escrit:
> 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, i see a std::vector not an array.

svn diff -r10038:10039
-       std::deque<T> mTokenQueue;
+       std::vector<T> mTokenQueue;

but also
+#include "Array.hxx"

i guess this include was added by mistake, right xavi?
(and the commit log was also kindof misleading)

remember this tips (or should be a "norm"?) about commits logs:
- use bullets "*"
- the modified file or class should be done explicit in the comment 
(unlike cvs, svn revisions are not per file)
- if the commit closes a bug, add the bug number in the comment, and the 
commit revision in the bug tracker
- if the commit accepts a patch in the list, answer the mail with the 
commit revision.

see the log;
http://cia.vc/stats/project/clam

pau





More information about the clam-devel mailing list