Skip to content

FastLayout 0.1.0 — Zero-Allocation Decoupled Layout Engine

Latest

Choose a tag to compare

@andrestubbe andrestubbe released this 15 Oct 11:28

FastLayout 0.1.0 [ALPHA-2026-10-15]

Zero-allocation, decoupled primitive layout engine for the FastJava ecosystem.

Key Features:

  • Zero-Allocation Hot Path: Operates purely over primitive float constraints with 0 bytes GC churn per layout pass.
  • Dual Output Modes:
    • AoS (\Rect[] out) for object-oriented component engines.
    • Flat contiguous float buffers (\ loat[] outBounds\ with stride: \x, y, w, h) for direct GPU / Vulkan vertex buffer streaming.
  • Pure SoA Kernel (\LayoutArena): Contiguous float arrays for constraints (\width[], \height[], \weight[], margins, clamping) to eliminate pointer chasing and maximize CPU L1/L2 cache prefetching.
  • Layout Algorithms:
    • \LinearLayout: Monomorphic horizontal & vertical loops (alignment, flex growth, min/max clamping).
    • \WrapLayout: Multi-line / multi-column responsive wrapping (flex-wrap for tag clouds and toolbars).
    • \GridLayout: 2D uniform grid layout with fixed/dynamic rows & columns.
  • Dirty Layout Tracking: Distinguishes structural changes from window resizes/drags to avoid unnecessary array synchronization.
  • JMH Profiled: Tested with OpenJDK JMH across 10, 100, and 1,000 element topologies (>44M ops/s measure, >14M ops/s arrange, <1 µs latency for typical UI toolbars).