| 365 | |
| 366 | impl ProfilingData { |
| 367 | fn with_node_capacity( |
| 368 | #[cfg(feature = "node_profiling")] node_capacity: usize, |
| 369 | #[cfg(feature = "node_profiling")] graph_out_id: NodeID, |
| 370 | ) -> Self { |
| 371 | #[cfg(feature = "node_profiling")] |
| 372 | let mut nodes = Vec::with_capacity(node_capacity); |
| 373 | #[cfg(feature = "node_profiling")] |
| 374 | nodes.push(NodeProfileData { |
| 375 | node_id: graph_out_id, |
| 376 | cpu_usage: 0.0, |
| 377 | }); |
| 378 | |
| 379 | Self { |
| 380 | version: 0, |
| 381 | overall_cpu_usage: 0.0, |
| 382 | engine_bookkeeping_cpu_usage: None, |
| 383 | #[cfg(feature = "node_profiling")] |
| 384 | nodes, |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | /// Performance profiling information of a Firewheel audio node. |