jtackaberry / reaticulate

An articulation management system for REAPER
Other
99 stars 45 forks source link

CPU Usage Very High When Using Many Instances of Reaticulate #61

Closed asaivan closed 5 years ago

asaivan commented 5 years ago

Greetings,

I have set up my templates with Reaticulate, which I'm really liking a lot, however, I'm running about 25 instances of it right now and my CPU usage is hovering around 90%. When I disable Reaticulate on a track, the CPU usage goes down. Is there some way of correcting this behavior? Or am I using Reaticulate wrongly?

I have my Strings, for example, 1st and 2nds Violins, Violas, Celli, Basses each on a separate track with a Reaticulate instance on each of those tracks. I do this with all my other orchestral sections as well. Is this incorrect?

I'm using the latest beta of Reaticulate via ReaPack.

Thanks for your assistance. Asai

jtackaberry commented 5 years ago

Hi Asai,

A few questions for you:

  1. What version of Reaper are you using?
  2. What CPU do you have?
  3. What OS are you using?
  4. How much of a CPU reduction do you see when disabling an instance on one of the tracks?

I don't imagine you're doing anything wrong. There may have been some performance regressions introduced in the prereleases that I should investigate.

Thanks!

asaivan commented 5 years ago

Thanks, Jason.

  1. Reaper v. 5.978
  2. Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz, 3201 Mhz, 4 Core(s), 4 Logical Processor(s)
  3. Windows 10 build 17134
  4. About 3%

Reaticulate is a very good application, and you're a talented programmer. I'm a bit of a programmer myself, and I can spot good coding, and your code is well written. I hope that you will continue with this endeavor. Reaper really needs articulation management so maybe they could take your code and merge it into their master branch, and take over maintenance of it when you've moved on to other projects. Have you discussed with them?

asaivan commented 5 years ago

Also, I did a little testing. I reinstalled Reaticulate 2.0 and checked CPU performance. Created a new project and loaded a string template.

Still seems high (20% CPU) when I have 5 tracks loaded (5 string tracks, under one "Strings" folder track). Although disabling Reaticulate plugins in FX window for each track didn't seem to have that much effect in this project. So I unloaded this template and loaded my older templates with 1 track / MIDI channel per articulation, for a total of 100 tracks, and CPU load was only 27%, which is to be expected due to Reaper's handling of track processing. So then I loaded up my Reaticulate templates again, but unloaded all the samples from Play (Hollywood Strings)... that did it. It dropped 10% CPU. So, I'm thinking it's Play, not Reaticulate at this point. I'll keep you posted if I find out anything more.

asaivan commented 5 years ago

Yep, confirmed, it's Play. False alarm. Sorry for the trouble.

jtackaberry commented 5 years ago

Thanks Asai for following up here. I also did some naive benchmarking and although there's probably some room for improvement with the JSFX, it doesn't seem too bad here either.

I tried a few things with Reaper fixed to using 1 audio thread, and then with 32 threads (I have a Threadripper 2950X):

Test % RT CPU w/ 1 thread % RT CPU w/ 32 threads
Idle (no tracks) 0.1% 0.2%
100 empty monitored tracks, 1 armed 0.8% 0.6%
100 monitored tracks, 1 armed, w/ Reaticulate JSFX 1.2% 1.6%
100 empty monitored tracks, all armed 4.6% 2.9%
100 monitored tracks, all armed w/ Reaticulate JSFX 8.2% 7.9%

Even with the worst case of all tracks being armed w/ Reaticulate, the non-RT total CPU % is around 0.3% for me. RT CPU is more sensitive and, to be sure, more relevant. Most people will just have a few tracks armed for recording, so I think 1-2% is a manageable RT overhead.

I'll close this issue, but please follow up if you have new findings and I can reopen it.

jtackaberry commented 5 years ago

Reaticulate is a very good application, and you're a talented programmer. I'm a bit of a programmer myself, and I can spot good coding, and your code is well written. I hope that you will continue with this endeavor.

Also, thanks for the compliment. ;)