3 ms·
Could you elaborate? I don’t see anything about improving the performance of enumerator. Zlinq appears to remove the penalty of allocating enumerators on the he
by Jordanpomeroy 1y ago
Could you elaborate? I don’t see anything about improving the performance of enumerator. Zlinq appears to remove the penalty of allocating enumerators on the heap to be garbage collected. The link you sent mention improvements, but I don’t see how they lead to linq avoiding heap allocations.
- giancarlostoro 1y agoNot just that but Zlinq also works across all C# environments it seems including versions embedded in game engines like Godot, Unity, .NET Standard, .NET 8 and 9.
- kevingadd 1y agoI believe they're referring to the stack allocation improvements, which would ideally allow all the LINQ temporary objects to live on the stack. I'm not sure whether it does in practice though.
- andyayers 1y agoUnfortunately, those improvements don't work for Linq. Some notes on why this is so here: https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/jit/DeabstractionAndConditionalEscapeAnalysis.md#linq https://github.com/dotnet/runtime/blob/main/docs/design/core...
- zamalek 1y agoAw, I had no idea that it didn't work out. If they work that out I'd put good money on a colossal perf boost across the board.
- moomin 1y agoSelect doesn’t have to return IEnumerable. A struct that exposes the same methods will work. So allocate-free foreach is very possible.
- debugnik 1y agoBut that's what ZLinq does, not what the upcoming changes to .NET do. What's your point?