@@ -151,10 +151,10 @@ impl RenderThread {
151151 let num_frames = ( length + RENDER_QUANTUM_SIZE - 1 ) / RENDER_QUANTUM_SIZE ;
152152
153153 for _ in 0 ..num_frames {
154- // handle addition/removal of nodes/edges
154+ // Handle addition/removal of nodes/edges
155155 self . handle_control_messages ( ) ;
156156
157- // update time
157+ // Update time
158158 let current_frame = self
159159 . frames_played
160160 . fetch_add ( RENDER_QUANTUM_SIZE as u64 , Ordering :: SeqCst ) ;
@@ -168,8 +168,14 @@ impl RenderThread {
168168 node_id : Cell :: new ( AudioNodeId ( 0 ) ) , // placeholder value
169169 } ;
170170
171- // render audio graph
172- let rendered = self . graph . as_mut ( ) . unwrap ( ) . render ( & scope) ;
171+ // Render audio graph
172+ let graph = self . graph . as_mut ( ) . unwrap ( ) ;
173+
174+ // For x64 and aarch, process with denormal floats disabled (for performance, #194)
175+ #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
176+ let rendered = no_denormals:: no_denormals ( || graph. render ( & scope) ) ;
177+ #[ cfg( not( any( target_arch = "x86" , target_arch = "x86_64" , target_arch = "aarch64" ) ) ) ]
178+ let rendered = graph. render ( & scope) ;
173179
174180 rendered. channels ( ) . iter ( ) . enumerate ( ) . for_each (
175181 |( channel_number, rendered_channel) | {
@@ -186,10 +192,15 @@ impl RenderThread {
186192 }
187193
188194 pub fn render < S : FromSample < f32 > + Clone > ( & mut self , output_buffer : & mut [ S ] ) {
189- // collect timing information
195+ // Collect timing information
190196 let render_start = Instant :: now ( ) ;
191197
192- // perform actual rendering
198+ // Perform actual rendering
199+
200+ // For x64 and aarch, process with denormal floats disabled (for performance, #194)
201+ #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
202+ no_denormals:: no_denormals ( || self . render_inner ( output_buffer) ) ;
203+ #[ cfg( not( any( target_arch = "x86" , target_arch = "x86_64" , target_arch = "aarch64" ) ) ) ]
193204 self . render_inner ( output_buffer) ;
194205
195206 // calculate load value and ship to control thread
0 commit comments