Skip to main content

ass_renderer/renderer/
metrics.rs

1//! Performance metrics and cache statistics for the renderer
2
3#[cfg(not(feature = "nostd"))]
4use std::time::Duration;
5
6/// Performance metrics for rendering
7#[derive(Debug, Clone)]
8pub struct PerformanceMetrics {
9    #[cfg(not(feature = "nostd"))]
10    /// Time spent parsing the script
11    pub parse_time: Duration,
12    #[cfg(not(feature = "nostd"))]
13    /// Time spent shaping text
14    pub shape_time: Duration,
15    #[cfg(not(feature = "nostd"))]
16    /// Time spent rendering
17    pub render_time: Duration,
18    #[cfg(not(feature = "nostd"))]
19    /// Total time for the operation
20    pub total_time: Duration,
21    #[cfg(feature = "nostd")]
22    pub parse_time: u64, // milliseconds
23    #[cfg(feature = "nostd")]
24    pub shape_time: u64, // milliseconds
25    #[cfg(feature = "nostd")]
26    pub render_time: u64, // milliseconds
27    #[cfg(feature = "nostd")]
28    pub total_time: u64, // milliseconds
29}
30
31/// Cache statistics
32#[derive(Debug, Clone)]
33pub struct CacheStatistics {
34    /// Number of glyph cache hits
35    pub glyph_hits: usize,
36    /// Number of font database entries
37    pub font_entries: usize,
38}