Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.10
-
None
-
730cbad8824bcfcb7ab60371a6563cfb6dd5658d (qt/qtbase/5.12)
Description
The attached application profiles the time it takes for QClipboard getters to execute. With nothing (or non-image contents like text) on the clipboard, execution takes 50+ ms:
qml: 16:17:14:956 before Clipboard.isImage() qml: 16:17:15:011 after Clipboard.isImage()
With a 200x150 image copied, the first call takes a little longer:
qml: 16:20:27:062 before Clipboard.isImage() qml: 16:20:27:167 after Clipboard.isImage() qml: 16:20:27:167 before Clipboard.imageWidth() qml: 16:20:27:225 after Clipboard.imageWidth() qml: 16:20:27:225 before Clipboard.imageHeight() qml: 16:20:27:277 after Clipboard.imageHeight()
With a 2067x1163 image (e.g. this) copied, the first call takes a lot longer:
qml: 16:23:00:895 before Clipboard.isImage() qml: 16:23:01:799 after Clipboard.isImage() qml: 16:23:01:799 before Clipboard.imageWidth() qml: 16:23:01:851 after Clipboard.imageWidth() qml: 16:23:01:851 before Clipboard.imageHeight() qml: 16:23:01:903 after Clipboard.imageHeight()
I would expect the first call (the image is presumably cached for subsequent calls) to be slightly longer as the image size grows, but it seems quite slow, and the "flat rate" of 50+ms is noticeable in a UI that calls the QClipboard API between the user clicking a button and a popup opening.