mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-10 06:12:14 +02:00
Use unordered maps for VST3 plugin instances
The better algorithmic time complexity should help when using many (say, hundreds) of instances of a single VST3 plugin.
This commit is contained in:
@@ -744,7 +744,7 @@ class AdHocSocketHandler {
|
||||
|
||||
// This works the exact same was as `active_plugins` and
|
||||
// `next_plugin_id` in `GroupBridge`
|
||||
std::map<size_t, Thread> active_secondary_requests{};
|
||||
std::unordered_map<size_t, Thread> active_secondary_requests{};
|
||||
std::atomic_size_t next_request_id{};
|
||||
std::mutex active_secondary_requests_mutex{};
|
||||
accept_requests(
|
||||
|
||||
@@ -526,7 +526,8 @@ class Vst3Sockets final : public Sockets {
|
||||
* would have one dedicated thread for handling function calls to these
|
||||
* interfaces, and then another dedicated thread just idling around.
|
||||
*/
|
||||
std::map<size_t, Vst3MessageHandler<Thread, AudioProcessorRequest>>
|
||||
std::unordered_map<size_t,
|
||||
Vst3MessageHandler<Thread, AudioProcessorRequest>>
|
||||
audio_processor_sockets;
|
||||
std::mutex audio_processor_sockets_mutex;
|
||||
};
|
||||
|
||||
@@ -529,7 +529,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
|
||||
/**
|
||||
* Memoizes `IEditController::getParameterInfo()`.
|
||||
*/
|
||||
std::map<int32, Steinberg::Vst::ParameterInfo> parameter_info;
|
||||
std::unordered_map<int32, Steinberg::Vst::ParameterInfo> parameter_info;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -204,7 +204,7 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
|
||||
* `register_plugin_proxy()` in the constractor, and an instance is then
|
||||
* removed through a call to `unregister_plugin_proxy()` in the destructor.
|
||||
*/
|
||||
std::map<size_t, std::reference_wrapper<Vst3PluginProxyImpl>>
|
||||
std::unordered_map<size_t, std::reference_wrapper<Vst3PluginProxyImpl>>
|
||||
plugin_proxies;
|
||||
|
||||
private:
|
||||
|
||||
@@ -440,7 +440,7 @@ class Vst3Bridge : public HostBridge {
|
||||
* will cause all pointers to it to get dropped and the object to be cleaned
|
||||
* up.
|
||||
*/
|
||||
std::map<size_t, InstanceInterfaces> object_instances;
|
||||
std::unordered_map<size_t, InstanceInterfaces> object_instances;
|
||||
std::mutex object_instances_mutex;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user