pub struct SynthesisStageTimings {
pub speaker_encode: Duration,
pub tokenize: Duration,
pub prefill_build: Duration,
pub codec_rollout: Duration,
pub vocoder_decode: Duration,
pub post: Duration,
pub pipeline_overlap: Duration,
pub first_frame_latency: Duration,
pub codec_rollout_detail: CodecRolloutSubTimings,
pub generated_samples: usize,
pub sample_rate_hz: u32,
}Expand description
Per-stage wall times for a single crate::Qwen3TtsEngine::synthesize_with_profile call.
When pipelining is disabled, stages are sequential and their sum approximates
end-to-end latency. With pipelining (vocoder_chunk_size > 0), codec_rollout
and vocoder_decode overlap; use [total()] which accounts for this via
pipeline_overlap.
Fields§
§speaker_encode: DurationReference WAV → speaker embedding (zero if not used).
tokenize: DurationText → token ids (includes voice-clone ref+target path when applicable).
prefill_build: Durationbuild_prefill_inputs (text projection + codec input layout).
codec_rollout: Durationrollout_codec_frames_kv (talker prefill + autoregressive codec steps).
vocoder_decode: DurationVocoder decode to PCM.
post: DurationFlatten codec rows + optional ICL prefix trim on PCM.
pipeline_overlap: DurationTime saved by overlapping transformer and vocoder (pipelining). Zero when pipelining is disabled.
first_frame_latency: DurationTime from synthesis start to first generated codec frame (includes speaker encode + tokenize + prefill + first frame prediction). This is the theoretical minimum latency for streaming playback.
codec_rollout_detail: CodecRolloutSubTimingsSub-component breakdown within the codec_rollout stage.
generated_samples: usizeNumber of PCM samples in the final output (after prefix trim).
sample_rate_hz: u32Output sample rate (Hz).