Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QWebEngineView CPU and GPU usages are extremely high



  • 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?


  • Moderators

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



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


  • Moderators

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


Log in to reply