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
QtWS25 Last Chance

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 last edited by fatiao101
    #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?

    raven-worxR 1 Reply Last reply
    0
    • F fatiao101

      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?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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
      0
      • raven-worxR raven-worx

        @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 last edited by
        #3

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

        raven-worxR 1 Reply Last reply
        0
        • F fatiao101

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

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on 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
          0
          • raven-worxR raven-worx

            @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 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