Skip to content

PerformanceTips

Carlos Alberto Lopez Perez edited this page Oct 20, 2023 · 9 revisions

Introduction

This section lists several tips that can improve the performance of WPE or WebKitGTK on your hardware.

Enabling accelerated video decoding (gstreamer-gl)

Both WebKitGTK and WPE have a build option named gst_gl on its packageconfig (which is enabled by default). If enabled it will enable decoding of videos inside the engine directly to an opengl surface, which allows for zero-copy composition. In order to also leverage hardware accelerated video decoding a gstreamer plugin supporting the platform has to be included on the image. Check for example how this can be done on the guides for the RPi or i.MX6

Tuning Weston repaint-window

On some hardware and with some backends that run over a wayland session, it may happen that the weston default repaint window interval (7ms) is too low for WPE. That causes WPE to sometimes fail to deliver the frame in time for the vsync, causing a low frame-rate.

To see if you are affected by this, you can open this simple benchmark of requestAnimationFrame() with WPE and check the value you get on your board:

  • If you are getting a value lower than 60FPS, then an idea is try to modify the weston repaint-window value. To do that edit your weston.ini file (typically in /etc/weston.ini) and add something like this
    [core]
    repaint-window=15
    
  • After that, restart weston (or reboot the board).

The value is in milliseconds. The best value should be something between 7 and 1000/60. Try with different values to check which one works better on your board.

Set CPU governor to performance

Some workloads (for example: MotionMark) have better performance if the CPU is always set to the higher frequency.

  • You can try to temporally set it (until next reboot) with this command:
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
  • Or you can permanently set it by changing the kernel cmdline by adding the string cpufreq.default_governor=performance to the file /boot/cmdline.txt.