Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of VST3 shell plug-ins instantiation #530

Closed
wants to merge 3 commits into from

Conversation

fredmerging
Copy link

Instantiating a VST3 shell plug-in can be overkill. For example, if using Waves complete suite of plug-ins (more than 400 plug-ins), the instantiation of the first enumerated plug-in (e.g. Waves API-2500) is almost instant, while the instantiation of the bottom listed plug-ins (e.g. Waves Q10) can take more than a minute.
This code update avoids creating an instance of each component handled by a vst3 factory when opening a VST3 module, and instead just checks if the name of the provided description can be found in the enumerated classes of a vst3 factory. It allows a huge speed-up of plug-in instantiation for big VST3 shells such as Waves.

PClassInfo info;
factory->getClassInfo(i, &info);

if (std::strcmp(info.category, kVstAudioEffectClass) != 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely recall that many audio plugins don't support this method... I suggest testing with a variety of open-source plugs to be sure.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at DescriptionFactory to get a better sense of it.

Copy link
Author

@fredmerging fredmerging May 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked this piece of code from DescriptionFactory. Basically this findName() method I added is the same as DescriptionFactory::findDescriptionsAndPerform() but I removed anything that is not needed. So the criteria are the same as before except we don't instantiate and destroy the component.
What I want to check in this loop is:

  • the name of the component (does it match the the provided one nested in the passed description)
  • is it an audio processor (we ignore any user interface component)

…ng prefix)

Instantiating a VST3 shell plug-in can be overkill. For example, if using Waves complete suite of plug-ins (more than 400 plug-ins), the instantiation of the first enumerated plug-in (e.g. Waves API-2500) is almost instant, while the instantiation of the bottom listed plug-ins (e.g. Waves Q10) can take more than a minute.
This code update avoids creating an instance of each component handled by a vst3 factory when opening a VST3 module, and instead just checks if the name of the provided description can be found in the enumerated classes of a vst3 factory. It allows a huge speed-up of plug-in instantiation for big VST3 shells such as Waves.
changed findName() into findMatch() and added component uid check in addition to name
@tpoole
Copy link
Member

tpoole commented May 23, 2019

Thank you.

Added in 9c50bbd.

@tpoole tpoole closed this May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants