Hacker News new | ask | show | jobs
by martijn_himself 386 days ago
Could anyone more across the detail of this chime in on what this means for the 'average' .NET developer?

I rely heavily on LINQ calls in a .NET (Core) Web App, should I replace these with Zlinq calls?

Or is this only helpful in case you want to do LINQ operations on let's say 1000's of objects that would get garbage collected at the end of a game loop?

3 comments

It means that if you find a performance problem, and you could hand-code that performance problem away (e.g. use some for-loops and preallocated buffers etc instead of wrestling enumerables, adding to lists) then you may find it useful, because you can keep the code cleaner.

This is to the Queryable/Enumerable extensions what ValueTask is to Task, or ref struct to struct etc. If you are the type of developer that sees great benefit switching from Task to ValueTask then you will probably find this useful too.

Presumably you absolutely shouldn't use this on any EF Core LINQ expressions or you'll end up materializing the entire table!
In the article author writes about linq.js that he is not maintaining anymore but someone forked it.

I guess this library will at some point end up unmaintained after author is bored with it.

So I would not use it in any of my production code of a web app unless I get some problem I need to fix with this library specifically. Replacing all just because “it is faster” doesn’t seem good enough.

As the saying goes: if you don't know if you need something or not, you probably don't need it. :)

I have been using .NET (and LINQ) for many years on a daily basis, and I've yet to run into performance problems that can't be fixed by either rewriting the LINQ statement or do some other quick workarounds.

But will I try out ZLinq? Sure, but I won't create anything that depends on it.

I think many people don’t need to worry performance of reference type allocations vs value type.

I don’t mean to assume you do or do not need to worry about that consideration. But 99% of the code I’ve written does not need to be concerned about it.

It really depends on how simple / complex ZLinq is. Sometimes simple libraries are "done" and don't need constant updates.
Guy just published - definitely not finished. In 2-3 years after couple thousand people use it and bugs shake out it might be done.
It passes all of the tests for dotnets implementation of linq….

Seems pretty bug free for a first version.