obs-color-monitor icon indicating copy to clipboard operation
obs-color-monitor copied to clipboard

Idea: improve waveform calculation

Open norihiro opened this issue 2 years ago • 0 comments

Waveform calculation is the most slow part.

Consider these ideas.

  • swap row and column
  • Multiplications in the loop might take time such as (WV_SIZE-1 - b) * width*4. Consider to allocate the size in power-of-2 or calculate the multiplication before the loop and save the results on an array.

Below is a performance profile on i7-7700 vncserver.

Initializing OpenGL...
Loading up OpenGL on adapter Mesa/X.org llvmpipe (LLVM 11.0.0, 256 bits)
OpenGL loaded successfully, version 4.5 (Core Profile) Mesa 20.3.3, shading language 4.50
...
   |- vss_render: min=0.663 ms, median=0.725 ms, max=1.822 ms, 99th percentile=1.147 ms
   |   |- draw_vectorscope: min=0.063 ms, median=0.66 ms, max=1.119 ms, 99th percentile=1.026 ms
   |   |- draw: min=0 ms, median=0.02 ms, max=1.015 ms, 99th percentile=0.048 ms
   |   `- graticule: min=0.037 ms, median=0.04 ms, max=0.855 ms, 99th percentile=0.085 ms
   |- wvs_render: min=0.035 ms, median=2.733 ms, max=5.819 ms, 99th percentile=4.774 ms
   |   |- draw_waveform: min=0.021 ms, median=2.681 ms, max=5.022 ms, 99th percentile=4.689 ms
   |   |- draw: min=0 ms, median=0.032 ms, max=1.391 ms, 99th percentile=0.091 ms
   |   `- graticule: min=0.009 ms, median=0.013 ms, max=0.07 ms, 99th percentile=0.037 ms
   |- his_render: min=0.027 ms, median=1.16 ms, max=2.601 ms, 99th percentile=1.913 ms
   |   |- draw_histogram: min=0.026 ms, median=1.14 ms, max=1.972 ms, 99th percentile=1.852 ms
   |   `- draw: min=0 ms, median=0.019 ms, max=1.077 ms, 99th percentile=0.048 ms

norihiro avatar Jul 13 '21 11:07 norihiro