Performance Infrastructure: - FrameArena: O(1) per-frame allocator with automatic reset - ObjectPool: Generic object pool for frequently allocated types - CommandPool: Specialized pool for draw commands - RingBuffer: Circular buffer for streaming data - ScopedArena: RAII pattern for temporary allocations Dirty Rectangle System: - Context now tracks dirty regions for partial redraws - Automatic rect merging to reduce overdraw - invalidateRect(), needsRedraw(), getDirtyRects() API - Falls back to full redraw when > 32 dirty rects Benchmark Suite: - Timer: High-resolution timing - Benchmark: Stats collection (avg, min, max, stddev, median) - FrameTimer: FPS and frame time tracking - AllocationTracker: Memory usage monitoring - Pre-built benchmarks for arena, pool, and commands Context Improvements: - Integrated FrameArena for zero-allocation hot paths - frameAllocator() for per-frame widget allocations - FrameStats for performance monitoring - Context.init() now returns error union (breaking change) New Widgets (from previous session): - Slider: Horizontal/vertical with customization - ScrollArea: Scrollable content region - Tabs: Tab container with keyboard navigation - RadioButton: Radio button groups - Menu: Dropdown menus (foundation) Theme System Expansion: - 5 built-in themes: dark, light, high_contrast, nord, dracula - ThemeManager with runtime switching - TTF font support via stb_truetype Documentation: - DEVELOPMENT_PLAN.md: 9-phase roadmap to DVUI/Gio parity - Updated WIDGET_COMPARISON.md with detailed analysis - Lego Panels architecture documented Stats: 17 widgets, 123 tests, 5 themes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
1.2 KiB
Zig
37 lines
1.2 KiB
Zig
//! Utils Module
|
|
//!
|
|
//! High-performance utilities for memory management, object pooling, and benchmarking.
|
|
//!
|
|
//! ## Components
|
|
//! - **FrameArena**: Per-frame arena allocator with O(1) reset
|
|
//! - **ObjectPool**: Generic object pool for frequently reused objects
|
|
//! - **CommandPool**: Specialized pool for draw commands
|
|
//! - **RingBuffer**: Circular buffer for streaming data
|
|
//! - **Benchmark**: Performance benchmarking utilities
|
|
|
|
pub const arena = @import("arena.zig");
|
|
pub const pool = @import("pool.zig");
|
|
pub const benchmark = @import("benchmark.zig");
|
|
|
|
// Re-exports
|
|
pub const FrameArena = arena.FrameArena;
|
|
pub const ScopedArena = arena.ScopedArena;
|
|
|
|
pub const ObjectPool = pool.ObjectPool;
|
|
pub const CommandPool = pool.CommandPool;
|
|
pub const RingBuffer = pool.RingBuffer;
|
|
|
|
pub const Benchmark = benchmark.Benchmark;
|
|
pub const Timer = benchmark.Timer;
|
|
pub const FrameTimer = benchmark.FrameTimer;
|
|
pub const AllocationTracker = benchmark.AllocationTracker;
|
|
|
|
// =============================================================================
|
|
// Tests
|
|
// =============================================================================
|
|
|
|
test {
|
|
_ = arena;
|
|
_ = pool;
|
|
_ = benchmark;
|
|
}
|