IndexedString vs. implicit sharing

Milian Wolff mail at milianw.de
Wed Oct 17 17:30:31 UTC 2012


Hey all!

Please test current master. I just pushed a big refactoring that makes the 
BackgroundParser use IndexedString's instead of KUrl's to greatly decrease 
memory consumption.

The reason more or less was that we did something like

project manager -> read files -> construct KUrl -> add as IndexedString to 
project's fileSet -> project import done -> convert IndexedString to KUrl -> 
add to background parser

If you look at the memory consumption of the new testStringSharing in 
test_itemrepository, you'll see that IndexedString does *not* leverage 
implicit sharing. Thus, use IndexedString wherever possible. Furthermore it is 
kinda expensive to convert between IndexedString and {QString,QByteArray,KUrl} 
so try to prevent that as well.

Now, who is up for fixing IndexedString to leverage implicit sharing? Sadly I 
still don't really understand the itemrepository magic. But couldn't we use 
QString's in there directly? Maybe that would require us to make IndexedString 
only operate on QString's but I'd be all for that anyways to increase type 
safety. But well, food for though...

Cheers, enjoy your memory :)
-- 
Milian Wolff
mail at milianw.de
http://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/20121017/fd8d0795/attachment.sig>


More information about the KDevelop-devel mailing list