ZLinq offers struct-based LINQ chains with low allocations for .NET Standard, modern .NET, Unity, and Godot, plus Span, tree, and SIMD-oriented variants.
Overview
ZLinq converts IEnumerable sources to value-type enumerables via AsValueEnumerable() to avoid per-chain heap allocations common in standard LINQ. Benchmarks report higher throughput on many patterns.
Operators aim for compatibility with recent .NET LINQ additions such as Shuffle, joins, and Sequence while backporting them to .NET Framework 4.8 and Unity targets. Tree helpers cover filesystem and JSON traversal; SIMD paths accelerate numeric aggregates where spans allow.
Optional source generators can drop in replacements without manual AsValueEnumerable calls. Limitations include IEnumerable interop, ref struct restrictions on modern .NET, and struct growth on long chains.
Packages ship on NuGet with dedicated Unity and Godot guidance.
Key features
- Value-type LINQ enumerables
- LINQ to Span operations
- LINQ to tree for files and JSON
- LINQ to SIMD aggregations
- .NET 10 operators on older runtimes
- PooledArray and CopyTo helpers
- Drop-in replacement generators
- Unity and Godot support
Use cases
- Performance-critical .NET queries
- Game logic in Unity without GC spikes
- Filesystem tree traversals
- Low-allocation numeric aggregates
- Backporting new LINQ APIs