Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngineView CPU and GPU usages are extremely high

QWebEngineView CPU and GPU usages are extremely high

Scheduled Pinned Locked Moved Unsolved QtWebEngine
5 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fatiao101
    wrote on 4 Dec 2021, 04:46 last edited by fatiao101 12 Apr 2021, 05:03
    #1

    I got an animated web page developed with Cocos2d from my workmate.
    Demo Link

    I use the Qt demo project “simplebrowser” to test the web page. When the page is loaded and stable,
    CPU and GPU usages are extremely high.
    But if I open the page in Chrome, the performance is normal.

    I tested three versions of Qt(I only need 32bit):

    1. Qt 5.7.1 msvc 2013 32bit
    2. Qt 5.8.0 msvc 2015 32bit
    3. Qt 5.12.3 msvc 2017 32bit

    They all showed the same performance(High CPU and GPU).

    Hardware:

    1. CPU: Intel Core i5-4590 3.3GHz
    2. Graphics Card:NVIDIA GeForce GT 710
    3. Memory: 8G

    Screenshots:

    1. Chrome 96.0.4664.45 (64 bit):
      09f9804a-17fc-4809-81b0-e7186afd39d9-image.png

    2. simplebrowser.exe(32bit):
      b2470b66-fdc6-40f4-96ca-4f310128590e-image.png

    3. simplebrowser.exe(32bit):
      Use:
      QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
      QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
      8740207e-5b35-428e-8e04-61e1584da6d3-image.png

    So,
    How can I reduce the CPU and GPU usages? Are there some configurations I can set?

    R 1 Reply Last reply 5 Dec 2021, 10:56
    0
    • F fatiao101
      4 Dec 2021, 04:46

      I got an animated web page developed with Cocos2d from my workmate.
      Demo Link

      I use the Qt demo project “simplebrowser” to test the web page. When the page is loaded and stable,
      CPU and GPU usages are extremely high.
      But if I open the page in Chrome, the performance is normal.

      I tested three versions of Qt(I only need 32bit):

      1. Qt 5.7.1 msvc 2013 32bit
      2. Qt 5.8.0 msvc 2015 32bit
      3. Qt 5.12.3 msvc 2017 32bit

      They all showed the same performance(High CPU and GPU).

      Hardware:

      1. CPU: Intel Core i5-4590 3.3GHz
      2. Graphics Card:NVIDIA GeForce GT 710
      3. Memory: 8G

      Screenshots:

      1. Chrome 96.0.4664.45 (64 bit):
        09f9804a-17fc-4809-81b0-e7186afd39d9-image.png

      2. simplebrowser.exe(32bit):
        b2470b66-fdc6-40f4-96ca-4f310128590e-image.png

      3. simplebrowser.exe(32bit):
        Use:
        QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
        QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
        8740207e-5b35-428e-8e04-61e1584da6d3-image.png

      So,
      How can I reduce the CPU and GPU usages? Are there some configurations I can set?

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 5 Dec 2021, 10:56 last edited by
      #2

      @fatiao101
      some env varibales which come to mind you can try:
      QTWEBENGINE_DISABLE_GPU_THREAD=1
      QTWEBENGINE_CHROMIUM_FLAGS="--disable-viz-display-compositor"
      only when using QML:
      QSG_RENDER_LOOP=basic

      are you testing release builds?!

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      F 1 Reply Last reply 6 Dec 2021, 08:56
      0
      • R raven-worx
        5 Dec 2021, 10:56

        @fatiao101
        some env varibales which come to mind you can try:
        QTWEBENGINE_DISABLE_GPU_THREAD=1
        QTWEBENGINE_CHROMIUM_FLAGS="--disable-viz-display-compositor"
        only when using QML:
        QSG_RENDER_LOOP=basic

        are you testing release builds?!

        F Offline
        F Offline
        fatiao101
        wrote on 6 Dec 2021, 08:56 last edited by
        #3

        @raven-worx Thank you for reply. Release version has the same performance. The configurations you recommended are not working.

        R 1 Reply Last reply 6 Dec 2021, 09:34
        0
        • F fatiao101
          6 Dec 2021, 08:56

          @raven-worx Thank you for reply. Release version has the same performance. The configurations you recommended are not working.

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 6 Dec 2021, 09:34 last edited by
          #4

          @fatiao101
          you can try very sleepy (with your debug build) and check in which methods the CPU spends the most time

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          F 1 Reply Last reply 3 Mar 2022, 02:46
          0
          • R raven-worx
            6 Dec 2021, 09:34

            @fatiao101
            you can try very sleepy (with your debug build) and check in which methods the CPU spends the most time

            F Offline
            F Offline
            fatiao101
            wrote on 3 Mar 2022, 02:46 last edited by
            #5

            @raven-worx
            After testing, for my case, it is mainly caused by the frame rate of the cocos2d-js web page. The default frame rate is 60. I changed it to 30 for either canvas or webgl render mode. The usages of CPU and GPU dropped significantly.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved