Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
-
25
-
Foundation PM Staging
Description
The epic's descriptions states
- A value-based QCache that doesn't need the cached items allocated on the heap (special usecase: QCache that holds items as shared_ptr so items aren't killed from under users; this would work with a value-based cache container, but it doesn't (without double indirection) using the current pointer-based QCache)
Turns out QtLocation has a QCache3Q, which, while not value-based, at least uses shared_ptr (currently QSharedPointer, would have to be ported).
Some "obvious" improvements would have to be done, first:
- port from QSharedPointer to std::shared_ptr
- Extract Base Class QCache3Q<Key>, holding the value as shared_ptr<void>
- Check whether a BaseBase can be extracted that doesn't depend on any template parameters and could be out-of-line'd
- Analyse the behaviour to check that the port from Q5Hash (= std::unordered_map) to Q6Hash did break performance characteristics
- Even so, consider using std::unordered_map, because QCache3Q is non-copyable, and node_handle would allow to potentially hold Node by value, avoiding the indirection though Node*.