Old 02-15-2023, 03:15 PM   #1
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,142
Default Performance optimization for JSFX

I have developed a JSFX that loads many large image files to display the user interface. Unfortunately, I can't load many JSFX instances into a Reaper project because it quickly fills up my memory. I suspect this is due to the many large image files that each JSFX instance loads. Is there any way to be able to load many JSFX instances into a Reaper project without quickly filling up my RAM?

Last edited by mawi; 05-30-2023 at 11:20 AM.
mawi is offline   Reply With Quote
Old 05-30-2023, 11:21 AM   #2
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,142
Default

I did a little comparison with JSFX and VST2. Once 100 tracks with one JSFX instance each and then once 100 tracks with one VST2 instance each. Compared to VST2 and VST3, JSFX uses almost twice as much CPU and three times as much RAM. Is there any way to minimize/optimize the CPU and memory consumption of JSFX?

Last edited by mawi; 05-30-2023 at 11:28 AM.
mawi is offline   Reply With Quote
Old 05-30-2023, 11:55 AM   #3
Zeno
Human being with feelings
 
Zeno's Avatar
 
Join Date: Sep 2018
Location: HH
Posts: 872
Default

I'd say it depends on the type of plugin and what it does.

ext_tail_size would be one option you could use.
Another option would be to execute only the parts of the code that are actually needed.


It's hard to say without seeing your code.
Zeno is offline   Reply With Quote
Old 05-30-2023, 12:57 PM   #4
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,142
Default

Do the same test with e.g. SonicAnomaly S.LA.X. Once 100 tracks with JSFX and 100 tracks with VST2. Do you also have much more CPU and memory consumption with JSFX? What is the reason for that?

vst: https://plugins4free.com/plugin/2593/

jsfx: https://github.com/Sonic-Anomaly/Son...master/Plugins
mawi is offline   Reply With Quote
Old 05-30-2023, 01:16 PM   #5
mawi
Human being with feelings
 
Join Date: Apr 2011
Location: Germany
Posts: 1,142
Default

The folder with the image files for my JSFX is about 18MB on the hard disk. When I load my JSFX with the images it consumes about 180MB of RAM per instance.

Last edited by mawi; 05-30-2023 at 03:35 PM.
mawi is offline   Reply With Quote
Old 05-30-2023, 07:49 PM   #6
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
Default

Are you resizing the images?

It could be that the images are constantly being resized, this is obviously bad. Put a check in there such that the image is only resized when the window size changes.
James HE is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.