From d7459354f58d1b71fc0c5ec48de9242e6a2fd00c Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 25 Sep 2017 13:06:42 -0500 Subject: 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) --- src/audio_core/hle/source.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/audio_core/hle') diff --git a/src/audio_core/hle/source.h b/src/audio_core/hle/source.h index ccb7f064f..c4d2debc2 100644 --- a/src/audio_core/hle/source.h +++ b/src/audio_core/hle/source.h @@ -108,7 +108,7 @@ private: u32 current_sample_number = 0; u32 next_sample_number = 0; - std::vector> current_buffer; + AudioInterp::StereoBuffer16 current_buffer; // buffer_id state -- cgit v1.2.3