Cpp Parser & multibyte chars (bug 274430)

Milian Wolff mail at milianw.de
Sun Nov 20 20:24:38 UTC 2011

On Sunday 20 November 2011 19:36:08 Andreas Pakulat wrote:
> On 20.11.11 17:41:33, Milian Wolff wrote:
> > On Saturday 19 November 2011 19:09:07 David Nolden wrote:
> > > Using QString is not an option, because it not only affects
> > > memory-usage,
> > > but also efficiency.
> > 
> > I'd also be interested in why QString should be slower then QByteArray.
> > 
> > I also wonder whether the doubled mem consumption is so noticeable. I
> > would
> > not be suprised if it is negleglible compared to the size of the AST and
> > other stuff we create during the parse process. I mean it would be in the
> > range of $filesize which is rarely more than one megabyte...
> Since I don't know the internal structures of the C++ parser I'm just
> going to throw in here that each and every qbytearray member that the
> structure has will double its size.

There is only one "instance" that stores this data, which is the ParseSession. 
The AST and other parts just reference parts of the PreprocessedContents by 
offset + length. This won't change. And of course QVector & QString are 
implictily shared, so no issues with passing them around.

> Also you're talking about 'rarely
> more than 1 mb per file', but the parser usually reads tons of files and
> IIRC kdev is rather bad at freeing up space it has acquired at some
> point.

Woot? I'm not aware of any memory leaks? My KDevelop instance which I got 
running for the last ~4h with lots of projects only uses ~120MB of RAM. So 
what do you mean?

Milian Wolff
mail at milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20111120/c2e83cba/attachment.sig>

More information about the KDevelop-devel mailing list