mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-14 00:38:18 -05:00
Audio: Use std::deque instead of std::vector for the audio buffer type (StereoBuffer16).
The current code inserts and deletes elements from the beginning of the audio buffer, which is very inefficient in an std::vector. Profiling was done using VisualStudio2017's Performance Analyzer in Super Mario 3D Land. Before this change: AudioInterp::Linear had 14.14% of the runtime (inclusive) and most of that time was spent in std::vector's insert implementation. After this change: AudioInterp::Linear has 0.36% of the runtime (inclusive)
This commit is contained in:
@ -47,7 +47,7 @@ static void StepOverSamples(State& state, StereoBuffer16& input, float rate,
|
||||
state.xn1 = input[inputi + 1];
|
||||
state.fposition = fposition - inputi * scale_factor;
|
||||
|
||||
input.erase(input.begin(), input.begin() + inputi + 2);
|
||||
input.erase(input.begin(), std::next(input.begin(), inputi + 2));
|
||||
}
|
||||
|
||||
void None(State& state, StereoBuffer16& input, float rate, DSP::HLE::StereoFrame16& output,
|
||||
|
Reference in New Issue
Block a user