Review Request: reserve size

Floris Ruijter flo.ruijt at hotmail.com
Fri Mar 4 16:56:10 UTC 2011



> On March 3, 2011, 8:17 p.m., Milian Wolff wrote:
> > I wonder whether this is not possibly wasting memory if the contents have been less than reserved. I'd make sure by calling squeeze just before returning the result, see also: http://doc.qt.nokia.com/latest/qvector.html#squeeze
> > 
> > Then please send me the patch as created by "git format-patch" then I'll apply it.
> > 
> > btw: you should apply for a dev account, good work!
> > 
> >

I've pushed it myself with the squeeze call.


- Floris


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100737/#review1756
-----------------------------------------------------------


On Feb. 24, 2011, 10:58 p.m., Floris Ruijter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100737/
> -----------------------------------------------------------
> 
> (Updated Feb. 24, 2011, 10:58 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Summary
> -------
> 
> by calling reserve upfront some time is saved. 
> 
> 
> Diffs
> -----
> 
>   languages/cpp/parser/rpp/chartools.cpp 91612bd 
> 
> Diff: http://git.reviewboard.kde.org/r/100737/diff
> 
> 
> Testing
> -------
> 
> i did several tests with duchainify on the cpp subtree to find the fastest denominator (it's 10)
> 
> no prealloc
> real	4m47.104s
> user	1m31.478s
> sys	0m16.549s
> 
> prealloc 1/8
> real	4m35.194s
> user	1m30.786s
> sys	0m16.341s
> 
> prealloc 1/9
> real	4m34.568s
> user	1m30.870s
> sys	0m15.917s
> 
> prealloc 1/10
> real	4m32.682s
> user	1m29.150s
> sys	0m15.941s
> 
> prealloc 1/11
> real	4m35.614s
> user	1m28.390s
> sys	0m15.949s
> 
> prealloc 1/12
> real	4m39.231s
> user	1m27.613s
> sys	0m16.209s
> 
> 
> Thanks,
> 
> Floris
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110304/b42a0904/attachment.html>


More information about the KDevelop-devel mailing list