mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00: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:
		
							parent
							
								
									d881dee818
								
							
						
					
					
						commit
						d7459354f5
					
				
					 5 changed files with 9 additions and 7 deletions
				
			
		|  | @ -108,7 +108,7 @@ private: | |||
| 
 | ||||
|         u32 current_sample_number = 0; | ||||
|         u32 next_sample_number = 0; | ||||
|         std::vector<std::array<s16, 2>> current_buffer; | ||||
|         AudioInterp::StereoBuffer16 current_buffer; | ||||
| 
 | ||||
|         // buffer_id state
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue