RUST · UI & DISPLAY MATH

aesir-utils-rs — Resolution-Independent Ultrawide & Multi-Monitor UI Layout Math

aesir-utils-rs is a zero-dependency Rust math library for scaling game interfaces and HUDs across 16:9, 21:9 ultrawide, 32:9 super-ultrawide, and bezel-corrected multi-monitor displays. It computes safe-zone anchor rectangles, aspect-ratio letterboxing, and DPI-aware coordinate transforms in sub-microsecond time.

$ cargo add aesir-utils-rs
GitHub ↗
Screen Bounds
Safezone Perimeter ($S \in [0.8, 1.0]$)
UI Anchor Points (Minimap, HUD, Reticle)
Excluded Screen Margins
Verified Benchmarks Apple Silicon M-Series ARM64

aesir-utils-rs vs FiveM Lua / CEF Script Engines

Head-to-head performance comparing native pure Rust with zero heap allocations vs dynamic FiveM Lua coordinate math.

Full Benchmark Report (BENCHMARKS.md) →
Safezone & NDC Mapping
4.18 ns
48× – 108× faster vs Lua (239M/s)
Aspect & Viewport Fit
6.88 ns
29× – 73× faster vs Lua (145M/s)
9-Way Anchor Placement
3.19 ns
94× – 251× faster vs Lua (313M/s)
100-Elem Canvas Rescale
0.118 µs
169× – 380× faster (8.4M frames/s)
Scenario / Workload aesir-utils-rs (Rust) FiveM Lua Script Speedup / Impact Memory Overhead
Safezone Bounds & Two-Way Safe NDC 4.18 ns / eval 150 – 450 ns 48× – 108× faster 0 bytes (Registers)
Aspect Ratio Category & Viewport Fit 6.88 ns / eval 180 – 500 ns 29× – 73× faster 0 bytes (Stack)
9-Way Anchor Inward Placement 3.19 ns / eval 250 – 800 ns 94× – 251× faster 0 bytes (LUT)
Virtual 1080p Canvas (100 HUD Elements) 0.118 µs / frame 15 – 45 µs 169× – 380× faster 0 bytes (Zero GC)
Run the benchmark suite locally with Cargo: cargo run --release --example bench_vs_original