⚡ High-performance multi-item layout engine for the FastJava ecosystem.
FastGrid provides pure math pipelines for computing Grid, Masonry, and Gallery layouts. It operates entirely on float[] arrays to achieve true zero-allocation during layout passes, completely eliminating Garbage Collection stutter during high-FPS animations and window resizing.
Watch the Demo
Standard layout engines (like AWT LayoutManagers, JavaFX, or Swing) instantiate objects (like Rectangle, Cell, Bounds) for every item during every layout pass. When calculating dynamic layouts at 60+ FPS, this creates immense garbage collection pressure.
FastGrid takes a different approach:
- No Objects: It reads from a flat input array of aspect ratios and writes to a pre-allocated flat
float[]output array. - Pure Math: Decoupled from rendering APIs. It computes the math and returns the raw coordinates
[x1, y1, w1, h1, x2, y2, w2, h2, ...]. - Cache Locality: By packing everything tightly into primitive arrays, it achieves insane throughput by leveraging CPU cache lines.
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastgrid</artifactId>
<version>v0.1.0</version>
</dependency>Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋
