Proposal to introduce a KDE::stringCache
Alexander Neundorf
neundorf at kde.org
Thu Feb 26 18:58:07 CET 2004
On Thursday 26 February 2004 18:17, Dr. Juergen Pfennig wrote:
...
> For such situations we should create a little cache that tracks maybe the
> last 64 QStrings that were created. If we try to create a new QString
> having data that is still known by this cache, the cached QString-data
> should should be referenced (QString works internally with references).
> This saves one memory block for each match. Example:
>
> atom.m_str = KDE::stringCache(source_unicode)
>
> or even better:
>
> atom.m_str = KDE::stringCache(source_latin, length)
Sounds interesting. How much would it help ? But wouldn't this have to be
done inside QString ? Ok, we could also find some places where it can help a
lot and use it there explicitely as you suggest.
E.g. all the QStrings containing the owner, group and file type of a file item
in konqy ?
Are you really sure there is nothing shared ? (probably not, but just to make
sure..)
Maybe you could try to implement this in KFileItem and measure the effects ?
Bye
Alex
--
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org - http://www.kde.org
alex at neundorf.net - http://www.neundorf.net
More information about the Kde-optimize
mailing list