Review Request 110686: Reduce KFileItemModel memory usage by implicitly sharing QByteArrays
Mark Gaiser
markg85 at gmail.com
Wed May 29 18:45:43 BST 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110686/#review33370
-----------------------------------------------------------
Hi Frank,
I noticed this ticket and took a small nose dive in string optimization. Your approach (as well as the kmail version) is simple and effective, that's for sure!
However, i think it can be done even more effective. If you would do the same only using a Trie (http://en.wikipedia.org/wiki/Trie or one of it's variants) then you would gain a whole lot more. Then you get very cheap string completion when searching (or typing in the url bar) and the memory usage will go down even more.
Funnily enough, Qt (or actually Qt Creator) has a documented Trie implementation: http://doc-snapshot.qt-project.org/qtcreator-extending/qmljs-persistenttrie-trie.html The downside is that you can't use it directly. You would have to copy the class either into dolphin or into kdelibs from frameworks (which would make it pointless for the current dolphin). It's quite a bummer that Qt doesn't come with a Trie like class naively.
I'm guessing you won't go this route due to more files to maintain, but it certainly is worth to take a look at it :)
- Mark Gaiser
On May 28, 2013, 4:44 a.m., Frank Reininghaus wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110686/
> -----------------------------------------------------------
>
> (Updated May 28, 2013, 4:44 a.m.)
>
>
> Review request for Dolphin.
>
>
> Description
> -------
>
> The summary says it all. The idea is based on http://milianw.de/blog/katekdevelop-sprint-vienna-2012-take-1
>
>
> Diffs
> -----
>
> dolphin/src/kitemviews/kfileitemmodel.h 1d837cb
> dolphin/src/kitemviews/kfileitemmodel.cpp d30d9e5
>
> Diff: http://git.reviewboard.kde.org/r/110686/diff/
>
>
> Testing
> -------
>
> Opened a directory with 100000 files with the default view properties. Memory usage as reported by ksysguard is reduced from 309 MB to 280.5 MB.
>
>
> Thanks,
>
> Frank Reininghaus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130529/85113d0c/attachment.htm>
More information about the kfm-devel
mailing list