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:
Robbert van der Helm
2021-06-11 14:48:28 +02:00
parent dec19dc12a
commit aaf3e7438c
6 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -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(
+2 -1
View File
@@ -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;
};