0

Which one is fast Linq and Stored procedure????

28th Nov 2016, 1:54 PM
Tamil Karthi
Tamil Karthi - avatar
2 Answers
0
since linq has to be generated into sql statements in order to run on a sql db, it has at least one more step of computation than calling a sp directly. so sp must be faster at runtime.
28th Nov 2016, 8:20 PM
Nima Chokami
Nima Chokami - avatar
0
Stored procedures are faster as compared to LINQ query since they have a predictable execution plan and can take the full advantage of SQL features. Hence, when a stored procedure is being executed next time, the database used the cached execution plan to execute that stored procedure. LINQ has full type checking at compile-time and Intellisense support in Visual Studio as compared to stored procedure. This powerful feature helps you to avoid run-time errors. LINQ allows debugging through .NET debugger as compared to stored procedure. LINQ also supports various .NET framework features like multi –threading as compared to stored procedures. LINQ provides the uniform programming model (means common query syntax) to query the multiple databases while you need to re-write the stored procedure for different databases. Stored procedure is a best way for writing complex queries as compared to LINQ. Deploying LINQ based application is much easy and simple as compared to stored procedures based. Since in case of stored procedures, you need to provide a SQL script for deployment but in case of LINQ everything gets complied into the DLLs. Hence you need to deploy only DLLs.
30th Nov 2016, 2:18 PM
Akwin Lopez
Akwin Lopez - avatar