Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1044

Help: Rainmeter Skins • Performance testing

$
0
0
I picked up RainMeter about two weeks ago... and ended up recoding a lot of different skins to try and learn the basics. What I really wanted though was a good performing audio meter. I tested a lot, perhaps about 30ish, but the performance on my machine (roughly 10 years old now) was terrible. So I put on my coder hat, found a simple bar skin, and started putting it through its paces to see what could be optimized. Note: This is a hog with 59 Measures and 59 Meters using the AudioLevel plugin. Thought I would share my results.

Changing FFTSize, FFTOverlap, and related settings: no noticeable difference
Various optimizations and changes to the Measures: no noticeable difference
<I could not find a way to reduce the number of Measures so moved on to the Meters>
Various optimizations and changes to the Meters: no noticeable difference

But... I did think of one simple trick which did work. I found I could reduce the number of Meters.

Original code snip:

Code:

[MeasureAudioOutput]Measure=PluginPlugin=AudioLevelFFTSize=2048FFTOverlap=128FFTAttack=0FFTDecay=150FreqMin=20FreqMax=15000Sensitivity=40Bands=59[MeasureAudio1]Measure=PluginPlugin=AudioLevelParent=MeasureAudioOutputType=BandBandIdx=1AverageSize=#AverageSize#[MeasureAudio2]Measure=PluginPlugin=AudioLevelParent=MeasureAudioOutputType=BandBandIdx=2AverageSize=#AverageSize#...[MeterBar1]Meter=ShapeX=2Y=75DynamicVariables=1Shape  =Rectangle 10,0,6.4,(-83.6*[MeasureAudio1]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0[MeterBar2]Meter=ShapeX=10rY=0rDynamicVariables=1Shape  =Rectangle 10,0,6.4,(-83.6*[MeasureAudio1]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0...
I snipped a lot of the code as redundant. I am sure you can imagine 59 of each of them. Well with a bit of tinkering I replaced the 59 meters with a single meter.

Code:

[MeterBar1]Meter=ShapeX=2Y=75DynamicVariables=1Shape  =Rectangle 10,0,6.4,(-83.6*[MeasureAudio1]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape2 =Rectangle 20,0,6.4,(-83.6*[MeasureAudio2]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape3 =Rectangle 30,0,6.4,(-83.6*[MeasureAudio3]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape4 =Rectangle 40,0,6.4,(-83.6*[MeasureAudio4]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape5 =Rectangle 50,0,6.4,(-83.6*[MeasureAudio5]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape6 =Rectangle 60,0,6.4,(-83.6*[MeasureAudio6]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape7 =Rectangle 70,0,6.4,(-83.6*[MeasureAudio7]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape8 =Rectangle 80,0,6.4,(-83.6*[MeasureAudio8]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0Shape9 =Rectangle 90,0,6.4,(-83.6*[MeasureAudio9]-6.4),3,3 | Fill Color #Color# | StrokeWidth 0...
Surprisingly, at least for me, my CPU went down from ~32% to ~9%. Not much really changed in the code. My only guess is that under the hood Meters have a decent amount of overhead to process. So, if you want a simple blazingly fast audio visualizer, just use one Meter!

Statistics: Posted by Pickles7853 — Today, 12:48 am



Viewing all articles
Browse latest Browse all 1044

Trending Articles