summaryrefslogtreecommitdiff
path: root/src/audio_core/hle/source.h
diff options
context:
space:
mode:
authorGravatar Subv2017-09-25 13:06:42 -0500
committerGravatar Subv2017-09-25 18:31:37 -0500
commitd7459354f58d1b71fc0c5ec48de9242e6a2fd00c (patch)
tree20aa98adee17b0a2886273806a62f333d1198ab4 /src/audio_core/hle/source.h
parentMerge pull request #2952 from MerryMage/page-tables (diff)
downloadyuzu-d7459354f58d1b71fc0c5ec48de9242e6a2fd00c.tar.gz
yuzu-d7459354f58d1b71fc0c5ec48de9242e6a2fd00c.tar.xz
yuzu-d7459354f58d1b71fc0c5ec48de9242e6a2fd00c.zip
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)
Diffstat (limited to 'src/audio_core/hle/source.h')
-rw-r--r--src/audio_core/hle/source.h2
1 files changed, 1 insertions, 1 deletions
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:
108 108
109 u32 current_sample_number = 0; 109 u32 current_sample_number = 0;
110 u32 next_sample_number = 0; 110 u32 next_sample_number = 0;
111 std::vector<std::array<s16, 2>> current_buffer; 111 AudioInterp::StereoBuffer16 current_buffer;
112 112
113 // buffer_id state 113 // buffer_id state
114 114