Expand description
Performance optimization functionality for HTML processing.
This module provides optimized utilities for HTML minification and generation, with both synchronous and asynchronous interfaces. The module focuses on:
- Efficient HTML minification with configurable options
- Non-blocking asynchronous HTML generation
- Memory-efficient string handling
- Thread-safe operations
§Performance Characteristics
- Minification: O(n) time complexity, ~1.5x peak memory usage
- HTML Generation: O(n) time complexity, proportional memory usage
- All operations are thread-safe and support concurrent access
§Examples
Basic HTML minification:
let path = Path::new("index.html");
let minified = minify_html(path)?;
println!("Minified size: {} bytes", minified.len());
Constants§
- Maximum allowed file size for minification (10 MB).
Functions§
- Asynchronously generates HTML from Markdown content.
- Synchronously generates HTML from Markdown content.
- Minifies HTML content from a file with optimized performance.