Every entry contains images who are memory expensive, so we don't want to store identical entries.
Details
- Reviewers
leinir dfaure - Group Reviewers
Frameworks - Commits
- R304:6de0754aa925: Limit request cache size
Diff Detail
- Repository
- R304 KNewStuff
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
KNewStuff does not use d pointers so changing QHash<QString, EntryInternal::List> to QHash<QString, QSet<EntryInternal>> will result in binary incomparability, no?
Technically no, since it doesn't change the size of the class itself (and requestCache is private and isn't used in any inline method).
The benefit of QSet over a linear search only starts after a large enough amount of elements in the set though. I have no idea about typical sizes here.
You are right, size will not change.
It can be really huge depend of requests intensity.
Well, if this QSet can be huge, then these conversions from QList and to QList are going to take a lot of CPU.
Are you sure it wouldn't be much faster to do a linear search at append time, in exchange for saving all those temporary-containers conversions?
This code looks VERY slow to me, due to the large amount of temporary memory allocations, and linear container conversions.
IMHO the method that returns a List forces us to keep using a List as the data structure.