top | item 44049474

(no title)

martijn_himself | 9 months 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?

discuss

order

alkonaut|9 months ago

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.

ComputerGuru|9 months ago

Presumably you absolutely shouldn't use this on any EF Core LINQ expressions or you'll end up materializing the entire table!

ozim|9 months ago

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.

thatwasunusual|9 months ago

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.

gwbas1c|9 months ago

It really depends on how simple / complex ZLinq is. Sometimes simple libraries are "done" and don't need constant updates.