Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62344

QClipboard::image() takes 50+ ms to execute on an Ubuntu machine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.2, 5.14.0 Alpha
    • 5.10
    • QPA: X11/XCB
    • 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.

      Attachments

        1. qtbug62344.tar.gz
          2 kB
        2. qtbug62344.gif
          qtbug62344.gif
          652 kB
        For Gerrit Dashboard: QTBUG-62344
        # Subject Branch Project Status CR V

        Activity

          People

            avolkov Alexander Volkov
            mitch_curtis Mitch Curtis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes