jclarke0000 / MMM-OpenWeatherForecast

Magic Mirror weather module using OpenWeather API
42 stars 25 forks source link

CPU consumption #14

Closed goldyfruit closed 2 years ago

goldyfruit commented 2 years ago

Hi,

My mirror had an over CPU consumption, I disabled all the modules until I found that this module was the one consuming the resources.

Here are top outputs with and without the module enabled:

Module disabled image

Module enabled image

This is my configuration:

  {
    module: "MMM-OpenWeatherForecast",
    classes: "default",
    position: "top_right",
    header: "Forecast",
    config: {
      apikey: "XX",
      latitude: 45.501690,
      longitude: -73.567253,
      displayKmhForWind: true,
      showFeelsLikeTemp: true,
      forecastLayout: "table",
      extraCurrentConditions: {
        highLowTemp: true,
        precipitation: true,
        sunrise: true,
        sunset: true,
        wind: true,
        barometricPressure: true,
        humidity: true,
        dewPoint: true,
        uvIndex: true,
        visibility: true
      },
    }
  },

I did some tests with version 2.18.0 and version 2.19.0 (develop branch) of MagicMirror with the same behavior.

I'm running everything within a Docker container with hardware acceleration on a Raspberry Pi 4B.

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Broadcom (0x14e4)
    Device: V3D 4.2 (0xffffffff)
    Version: 20.3.5
    Accelerated: yes
    Video memory: 3614MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 20.3.5
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Any idea of the root cause?

Thanks for the module :+1:

goldyfruit commented 2 years ago

After many tests, the load seems to be due to useAnimatedIcons, when set to false the CPU usage dropped.

image

goldyfruit commented 2 years ago

So, on a Raspberry Pi 4B 64-bit O/C to 2.1Ghz, CPU usage (not load average) dropped by 11% according to data collected since 10pm yesterday until now.

A note could be added to the README about this as same as for the animateMainIconOnly option.