@@ -151,10 +151,10 @@ impl RenderThread {
151
151
let num_frames = ( length + RENDER_QUANTUM_SIZE - 1 ) / RENDER_QUANTUM_SIZE ;
152
152
153
153
for _ in 0 ..num_frames {
154
- // handle addition/removal of nodes/edges
154
+ // Handle addition/removal of nodes/edges
155
155
self . handle_control_messages ( ) ;
156
156
157
- // update time
157
+ // Update time
158
158
let current_frame = self
159
159
. frames_played
160
160
. fetch_add ( RENDER_QUANTUM_SIZE as u64 , Ordering :: SeqCst ) ;
@@ -168,8 +168,14 @@ impl RenderThread {
168
168
node_id : Cell :: new ( AudioNodeId ( 0 ) ) , // placeholder value
169
169
} ;
170
170
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) ;
173
179
174
180
rendered. channels ( ) . iter ( ) . enumerate ( ) . for_each (
175
181
|( channel_number, rendered_channel) | {
@@ -186,10 +192,15 @@ impl RenderThread {
186
192
}
187
193
188
194
pub fn render < S : FromSample < f32 > + Clone > ( & mut self , output_buffer : & mut [ S ] ) {
189
- // collect timing information
195
+ // Collect timing information
190
196
let render_start = Instant :: now ( ) ;
191
197
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" ) ) ) ]
193
204
self . render_inner ( output_buffer) ;
194
205
195
206
// calculate load value and ship to control thread
0 commit comments