Ubuntu Components is hard on the disk and CPU when loading images
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Albert Astals Cid |
Bug Description
* Take the following simple example of a listview with an image.
* run it with strace qmlscene
* scroll the list to the bottom
When not including "import Ubuntu.Components 1.3" there is exactly one disk access to load the image
open("/
When including "import Ubuntu.Components 1.3" there are around 500 disk access including stats for the file and listing the directory containing the file (see disk_access file).
Also for each of those directory listings we're also creating and destroying the same QRegExp again and again.
I understand that some of this overhead is needed since we have that thing that loads the best possible file for the given grid units, but doing it again and again for the same file seems a bit of overkill, maybe we could cache that?
Related branches
- ubuntu-sdk-build-bot: Approve (continuous-integration)
- Cris Dywan: Approve
- Zsombor Egri: Needs Fixing
-
Diff: 268 lines (+120/-20)9 files modifiedsrc/UbuntuToolkit/ucqquickimageextension.cpp (+53/-2)
src/UbuntuToolkit/ucqquickimageextension_p.h (+1/-0)
tests/unit/qquick_image_extension/borderInName.sci (+0/-7)
tests/unit/qquick_image_extension/data/borderInName.sci (+7/-0)
tests/unit/qquick_image_extension/data/hundred_faces.qml (+13/-0)
tests/unit/qquick_image_extension/data/test@18.sci (+7/-0)
tests/unit/qquick_image_extension/qquick_image_extension.pro (+1/-1)
tests/unit/qquick_image_extension/test@18.sci (+0/-7)
tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp (+38/-3)
tags: | added: unity8 |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | New → In Progress |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
assignee: | nobody → Albert Astals Cid (aacid) |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | In Progress → Fix Committed |
that's an awesome find, well done! I'd love to take some time to do this kind of analysis :)