D12124: Avoid creating duplicate property entries in the cache

Stefan BrĂ¼ns noreply at phabricator.kde.org
Thu Apr 12 18:05:14 UTC 2018


bruns added a comment.


  In D12124#244924 <https://phabricator.kde.org/D12124#244924>, @broulik wrote:
  
  > Wouldn't make a big difference, would it?
  >
  > > If there are multiple items for key in the map, the value of the most recently inserted one is returned.
  >
  > It's not like we actually check for the property we're overriding with having a saner value.
  
  
  As allproperties is currently called directly from Manager::updateBackend (which is IMHO wrong and needs some cleanup), we end up with values from multiple GetAll calls for the same interface. Without the "cleanup after InterfaceRemoved" (D12126 <https://phabricator.kde.org/D12126>), the propertyCache for e.g. Loop interfaces contained each key 4 times, after D12126 <https://phabricator.kde.org/D12126> its only twice without this one.
  
  Fortunately QMap guarantees to use the last inserted value when there are multiple values for a key [1], so this is likely only annoying when debugging and a slight waste of memory/cpu time.
  [1] http://doc.qt.io/qt-5/qmap.html#find

REPOSITORY
  R245 Solid

BRANCH
  unique_properties

REVISION DETAIL
  https://phabricator.kde.org/D12124

To: bruns, #frameworks, broulik
Cc: broulik, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180412/bf0c67c8/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list