Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is LINQ a valid option?

Tags:

c#

linq

We (my team) are about to start development of a mission critical project, one of the sub-systems of this project is a Windows service. This service will be a backbone of the entire system and has to respond as per mission critical standard.

This service will contain many lists to minimize database interaction and to gain performance, I am estimating average size of a list to be 250,00 under normal circumstances.

Is it a good idea to use LINQ to query data from these queues, or should I follow my original plan of creating indexed list?

Indexed List is a custom implementation of Idictionary, which will work like an index and will have many performance oriented features such as MRU, Index rebuilding, etc.

like image 568
Abhishek Avatar asked Sep 27 '10 10:09

Abhishek


People also ask

Can we use LINQ in .NET core?

NET Core LINQ stands for Language Integrated Query. Language Integrated Query is one structured query that is used to retrieve data from the database and other different sources and formats. LINQ tutorials will assist you to find out the LINQ language using topics that go from basic to advanced.

How LINQ is useful?

LINQ simplifies this situation by offering a consistent model for working with data across various kinds of data sources and formats. In a LINQ query, you are always working with objects. You use the same basic coding patterns to query and transform data in XML documents, SQL databases, ADO.NET Datasets, .

Why we use LINQ instead of Ado net?

The DataSet is a key element of the disconnected programming model that ADO.NET is built on, and is widely used. LINQ to DataSet enables developers to build richer query capabilities into DataSet by using the same query formulation mechanism that is available for many other data sources.

Does LINQ improve performance?

It is slightly slower It's good to be aware of any performance tradeoff that might occur when you use LINQ to improve the readability of your code. And if you'd like to measure the performance difference, you can use a tool like BenchmarkDotNet to do so.


1 Answers

Before rolling your own solution, you might want to look at i4o, an indexed LINQ to Objects provider.

Otherwise, it sounds like applying your own indexing may well be worthwhile - but do performance tests first. "Mission critical" is often about reliability more than performance - if LINQ to Objects performs well enough, why not use it?

Even if you do end up writing your own collections, you should consider making them "LINQ queryable" in some fashion (which will depend on the exact nature of the collections)... it's nice to be able to write LINQ queries, even if it's not against vanilla LINQ to Objects.

like image 95
Jon Skeet Avatar answered Oct 24 '22 17:10

Jon Skeet