UCUnits::resolveResource takes up to 23% of unity8-dash's CPU time when scrolling a long scope

Bug #1604029 reported by Albert Astals Cid
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
ubuntu-ui-toolkit (Ubuntu)
Albert Astals Cid

Bug Description

According to the attached callgrind trace (obtaining scrolling up/down the fake_ubrick_scope) one can see that calls to Image item setSource end up intercepted by UCQQuickImageExtension::setSource that goes ends up in UCUnits::resolveResource

That takes 23% of the total CPU time looking for which file to actually open.(which is the given path since there's no @GU files at all)

Related branches

Revision history for this message
Albert Astals Cid (aacid) wrote :
Revision history for this message
Albert Astals Cid (aacid) wrote :

I have no magic fix for this though, suggestions include:
 * Remove this fuzzy matching of filenames
 * Somehow give the hability of opting out of this fuzzy filename matching
 * Caching the last X dirs, so at least repeat queries (like going up/down the same scope) are a bit faster.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This might be a direct duplicate of bug 1494795.

Because that was about 100% CPU on arale, which might be the same as only 23% CPU on a desktop or whatever you're using.

tags: added: performance
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → High
Revision history for this message
Albert Astals Cid (aacid) wrote :

No, it's not a direct duplicate.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Dywan (kalikiana) wrote :

Can we verify the following assertion? if you specify "foo.png" and rely on scaling, on disk it will have to be "foo@18.png" (replace 18 with any number(s)) and NEVER "foo.png". So why doesn't the lookup skip all the suffix search if the file "foo.png" exists verbatim?

description: updated
Changed in ubuntu-ui-toolkit (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Albert Astals Cid (aacid)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Committed
tags: added: unity8-desktop
Changed in canonical-devices-system-image:
status: New → Fix Committed
summary: - UCUnits::resolveResource takes up to 23% of CPU time when scrolling a
- long Unity8-dash Scope
+ UCUnits::resolveResource takes up to 23% of unity8-dash's CPU time when
+ scrolling a long scope
Changed in canonical-devices-system-image:
milestone: none → 13
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-ui-toolkit - 1.3.2060+16.10.20160814

ubuntu-ui-toolkit (1.3.2060+16.10.20160814) yakkety; urgency=medium

  [ Zoltan Balogh ]
  * Fix OptionSelectorTestCase tests.
  * Fix more OptionSelector autopilot tests

  [ Timo Jyrinki ]
  * Disable documentation building for GLES builds. Fixes LP: #1606222.
  * Replace abs with qFabs due to GCC6 breakage. Fixes LP: #1610943.
  * Limit s390x dependencies more due to upstart/s390x problems and removed
    packages in archives. Fixes LP: #1610951

  [ Andrea Bernabei ]
  * ListItemLayout doc: add elide mode change example and add section about
    labels default properties values. Fixes LP: #1603450.
  * ListItemLayout doc: add explicit note about the need to bind ListItem's
    height to layout's height.
  * More Scrollbar optimizations: 20% faster creation time. Fixes LP: #1606451
  * Scrollbar: fix wrong thumb color on tap/mouse release and increase coverage
    of hover states unit tests. Fixes LP: #1608897

  [ Zsombor Egri ]
  * Fix null pointer property initializer used with 1.3 PageWrapper.
    Fixes LP: #1604780.
  * Fix BottomEdge content URL preloading. Fixes LP: #1604509.

  [Albert Astals Cid ]
  * UCUnits::resolveResource: Prefer image path if it exists. This saves
    searching the disk for @gu images, which is a big speedup. According to
    callgrind loading 100 images from a folder that contains 380 images goes
    from around 3 million instructions per UCUnits::resolveResource call down
    to around 10 thousand. This optimization is ok since it is not correct to
    ship both image.png and image@20.png. You either have to ship gu-enabled
    files or not, but mixing them is not allowed. Searched for cases in which
    that may be happening in my phone and found none. Fixes LP: #1604029.

  [ Tim Peeters ]
  * Configure colors of the buttons in the ActionBar and PageHeader through
    their Styles. Fixes LP: #1597774.
  * Fix assigning of constant values to a grouped property in StyleHints.
    Fixes LP: #1602836.
  * Fix list view keyboard navigation for RightToLeft and BottomToTop
    directions. Fixes LP: #1605634
  * Use external QML files instead of embedded QML strings for autopilot tests.
    Fixes LP: #1578319
  * Fix failing autopilot header tests.
  * Fix ActionSelectionPopover Autopilot CPO tests.

  [Christian Dywan ]
  * Include indexes in "offline" docs and filter out link errors.
    Fixes LP: #1603937.
  * Increase focus ring thickness from 1dp to 2dp. Fixes LP: #1602690.
  * Add a snippet about tests to the toplevel README
  * Enter/Return to trigger, Space to expand ComboButton. Fixes LP: #1523817.
  * Initialize engine variable before using it in the _engine case.
  * Use Qt.rgba instead of #0000 checking ListItem default color.
    Fixes LP: #1560004
  * Don't use a different .desktop file in the gallery tests.
    Fixes LP: #1578319
  * Update scaling docs, set QT_SCALE_FACTOR and unset GRID_UNIT_PX.
    Fixes LP: #1610208

  [ Florian Boucault ]
  * Sections: load Icons asynchronously.

 -- Zoltán Balogh <email address hidden> Sun, 14 Aug 2016 09:06:46 +0000

Changed in ubuntu-ui-toolkit (Ubuntu):
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers