mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Preallocate small vectors for VST3 queues
Events, parameter changes, and the individual queues contained within the parameter changes all use dynamic memory allocation. Preallocating some memory for those things inside of the objects may prevent latency spikes when they those objects are first filled. This is especially useful for the parameter changes since there's no way to reserve memory in a vector of vectors.
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <pluginterfaces/vst/ivstparameterchanges.h>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
#include "../../bitsery/traits/small-vector.h"
|
||||
#include "base.h"
|
||||
#include "param-value-queue.h"
|
||||
|
||||
@@ -83,7 +85,7 @@ class YaParameterChanges : public Steinberg::Vst::IParameterChanges {
|
||||
/**
|
||||
* The parameter value changes queues.
|
||||
*/
|
||||
std::vector<YaParamValueQueue> queues;
|
||||
boost::container::small_vector<YaParamValueQueue, 16> queues;
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
Reference in New Issue
Block a user