Hacker News new | ask | show | jobs
by Kuinox 1615 days ago
I'm a C# dev, I know well LINQ.

LINQ has multiples issues compared to what I want to do.

It's slow (at leat 1000x slower than a for loop)

There is no query optimizer by default, and even less a runtime query optimiser.

It's directly translated to procedural code, it doesn't get compiled and translated like a query engine will do in an SQL DB.

1 comments

I’m far from a C# expert, I just happen to write some at work but that’s not my predilection language so you probably know better than me but, implementation appart, as a querying language, it feels pretty good.

Also, I understood that it was translated to IEnumerable queries, so, wouldn’t EF optimize the query ?

EF translate will translate your LINQ into SQL. I'm speaking about LINQ that you may write anywhere, not on a DB call in particular, there EF is not the right tool, there may be some things thats may make LINQ faster, but it's nowhere as good (it cant do much as most of the queries are little isolated queries) as a DB engine.