cysharp/zlinq

Zero allocation LINQ with LINQ to Span, LINQ to SIMD, and LINQ to Tree (FileSystem, JSON, GameObject, etc.) for all .NET platforms and Unity, Godot.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 13 minutes ago
Added to GitGenius on September 12th, 2026
Created on October 24th, 2014
Open Issues & Pull Requests: 5 (+0)
GitHub issues: Enabled
Number of forks: 214
Total Stargazers: 5,264 (+0)
Total Subscribers: 76 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

ZLinq is a zero-allocation LINQ implementation for C# that extends standard LINQ with support for Span, SIMD operations, and tree-structured data across all .NET platforms and game engines.

Standard LINQ allocates memory with each method chain, creating performance overhead unsuitable for latency-sensitive applications like games. ZLinq solves this by using struct-based enumerables that avoid heap allocations entirely while maintaining method chaining. The implementation integrates MoveNext and Current operations to reduce iterator overhead and minimizes struct size by eliminating unnecessary state. With .NET 9 and C# 13's allows ref struct feature, the tool provides natural Span support that standard LINQ cannot offer.

Developers working on performance-critical code—particularly game developers using Unity or Godot—should consider ZLinq as a drop-in replacement for standard LINQ. The tool suits projects targeting netstandard2.0 through net9 where allocation-free iteration matters. It implements operators equivalent to .NET 10, including newer methods like Shuffle, RightJoin, LeftJoin, Sequence, and InfiniteSequence, making it useful even on older frameworks. Beyond basic LINQ, the tool includes LINQ to Tree for traversing file systems and JSON structures, and LINQ to SIMD for automatic vectorization where applicable. A source generator option can automatically accelerate existing LINQ calls without code changes.

The project passes the full System.Linq.Tests suite from dotnet/runtime, demonstrating production-grade compatibility through thousands of test cases rather than experimental implementation. Benchmark workflows run continuously to track performance across various patterns, with results showing consistent advantages over standard LINQ in both allocation and speed metrics.