mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
💥 Reduce allocations in VST3 audio sockets
We do this by using this new `MessageReference<T>` type to avoid copying our `YaAudioProcessor::Process` struct and the contained `YaProcessData` object. This is only part of the work, but this redesign lets us keep the these objects alive on both the plugin and the host side. On the plugin side, we'll simply serialize the data from the referred to object without copying it. On the Wine side, we'll write the data to a persistent thread local object, and then reassign the `MessageReference<T>` to point to that object. This lets us serialize 'references', thus avoiding potentially expensive allocations. With these last few changes alone VST3 plugins are already at the same performance level as our optimized VST2 plugin groups.
This commit is contained in:
@@ -992,13 +992,15 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaAudioProcessor::Process& request) {
|
||||
bool Vst3Logger::log_request(
|
||||
bool is_host_vst,
|
||||
const MessageReference<YaAudioProcessor::Process>& request_wrapper) {
|
||||
return log_request_base(
|
||||
is_host_vst, Logger::Verbosity::all_events, [&](auto& message) {
|
||||
// This is incredibly verbose, but if you're really a plugin that
|
||||
// handles processing in a weird way you're going to need all of
|
||||
// this
|
||||
const YaAudioProcessor::Process& request = request_wrapper.get();
|
||||
|
||||
std::ostringstream num_input_channels;
|
||||
num_input_channels << "[";
|
||||
|
||||
Reference in New Issue
Block a user