[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: design discussion: caching QTextFormat for faster text loading
From: zander () kde ! org
Date: 2010-08-17 7:47:34
Message-ID: 201008170947.34593.zander () kde ! org
[Download RAW message or body]
On Monday 16. August 2010 19.41.46 Jos van den Oever wrote:
> So all being said, I do understand the solution you are proposing and I
> think that it is the solution which is fastest to implement given the
> current code. I do think it perpetuates the current uninsightful way in
> which styles are handled, yet it might be the best solution for the
> moment.
Notice that your assertion of many formats is not true; please write some test
code to convince yourself :)
So I agree its the fastest to implement since it continues the current
approach and just adds a cache on top.
As a besides I suggest you should take a little more care to not call the stuff
I wrote 'uninsightful' without checking your facts. Either way, its not nice.
> Nevertheless, if development time were free, I would favor a solution that
> - has one style cache per document
Use my suggestion of a QMap doing this and connect to the QTextDocument
destroyed signal to flush cache and you have a cache per document.
> - minimizes the sizes of all QTextFormat instances by placing as much
> style information in parent object (e.g. QTextFrame).
Not needed; there is a minimum amount of them already.
> - uses StyleKeys to access the formats in the cache
That would not have any benefit and would be way slower than comparing one
void* and one int as key.
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic