FX in practice tutorial: no CPU difference

I’m working through the tutorial on my MacBook Pro 16" 32GB. Section 6.2 “FX in practice” considers optimizing FX CPU usage using these three configs:

loop do
  with_fx :reverb do
    play 60, release: 0.1
    sleep 0.125
  end
end

with_fx :reverb do
  loop do
    play 60, release: 0.1
    sleep 0.125
  end
end

loop do
  with_fx :reverb do
    16.times do
      play 60, release: 0.1
      sleep 0.125
    end
  end
end

According to my process monitor, each config gives me exactly the same CPU load. Why? Is Sonic Pi smart enough that it now performs the same optimization under the hood to make up for user failure?

The difference is more noticeable if you increase the BPM. Try the above examples with use_bpm 120 at the top of the buffer.

1 Like

See this comment by Sam which explains a related question:

The issue is related to fx like reverb etc being more expensive for scsynth (the single processor version of the SuperCollider sound engine that Sonic Pi uses under the hood) to run. So the more reverb fx Sonic Pi has to process in a short amount of time, the less chance it will be able to keep up with all the instructions it’s given.