Newbie Linq Performance Question

  • Thread starter Thread starter Bishop
  • Start date Start date
B

Bishop

I'm just investigating Linq and it looks like it's a time saver for the
programmer. I'm wondering how the performance is if we want to use it with
our public websites?

We get an enormous amount of traffic. A while back we moved away from
gridviews on our public websites for the performance gain.
 
Bishop said:
I'm just investigating Linq and it looks like it's a time saver for the
programmer. I'm wondering how the performance is if we want to use it
with our public websites?

We get an enormous amount of traffic. A while back we moved away from
gridviews on our public websites for the performance gain.

This is a good article that may help in your evaluation.

http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx

I have been using it for quite a while and it is very responsive. Remember
that Linq is not only for Database operations, you can use it in many ways
to process lists etc.

http://msdn.microsoft.com/en-us/magazine/cc700332.aspx
http://msdn.microsoft.com/en-us/magazine/cc793963.aspx

LS
 
+ - One year ago i went to a MS seminar where LINQ was demonstrated , there
were 2 persons from Logica who showed us how they used LINQ to SQL in there
projects , when one of the attendees asked them about the processing
perfomance instead of the RAD perfomance ( because that is what they were
focussing at ) they answered that they had contacted MS about there
findings and that this would in the near future be much bether ! .

Then after some persuation from our side they showed there benchmark
application and it turned out that LINQ was teribly slow in comparisation to
traditional programming .

Ofcourse it could be that it is now much bether etc etc but AFAIK the superb
RAD perfomance of LINQ comes with the prize of less processing perfomance
ofcourse in a project where you know this in forehand you can compesate this
with upscaling of your hardware it is in my opinion just what you choose .

regards

Michel Posseth [MCP]
 
Michiel

What does it say that some people from Logica in the Netherlandsx tell that?

I can make any benchmark to show that something is slow.

Cor

Michel Posseth said:
+ - One year ago i went to a MS seminar where LINQ was demonstrated ,
there were 2 persons from Logica who showed us how they used LINQ to SQL
in there projects , when one of the attendees asked them about the
processing perfomance instead of the RAD perfomance ( because that is what
they were focussing at ) they answered that they had contacted MS about
there findings and that this would in the near future be much bether ! .

Then after some persuation from our side they showed there benchmark
application and it turned out that LINQ was teribly slow in comparisation
to traditional programming .

Ofcourse it could be that it is now much bether etc etc but AFAIK the
superb RAD perfomance of LINQ comes with the prize of less processing
perfomance
ofcourse in a project where you know this in forehand you can compesate
this with upscaling of your hardware it is in my opinion just what you
choose .

regards

Michel Posseth [MCP]



Lloyd Sheen said:
This is a good article that may help in your evaluation.

http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx

I have been using it for quite a while and it is very responsive.
Remember that Linq is not only for Database operations, you can use it in
many ways to process lists etc.

http://msdn.microsoft.com/en-us/magazine/cc700332.aspx
http://msdn.microsoft.com/en-us/magazine/cc793963.aspx

LS
 
Cor ,,

This were not just people who gave a demonstration just for fun , i am
talking about a Technet MSDN briefing we had here in the Netherlands when
you received the free copy of Vista and Windows 2008 .

Logica was at that time a early adaptor of Linq in a major wordwide project
directly supported by MS , as these 2 people were involved in that project
they were invited to share there experiences . The conclusion was that it
gives you a hughe perfomance boost in writing code , however it isn`t (
yet ) the fastest way of processing code .

But Microsoft is pretty honest regarding this even in official MS press
books and training kits you wil find that the author has other findings .
A nice example of this are Generics if you ever studied for 70-536 you might
have noticed that the author of the book could not reproduce the perfomance
benefit against type casting and yes this is written in the official self
paced training kit ( page 39 "Real World" ) .

I personally use LINQ and Generics a lot however when i have to process a
few million metering values ( because of my job as a production developer at
a energy billing company ) in the shortest amount of time i use the fastest
method and ofcourse the one that does not blow up in my face .

IMHO
All those new constructs give you a hughe coding speed advantage , and
should be favored wehenever possible but as with anny tool you must know
when to use it and when not ( yet ) .


Regards

Michel





Cor Ligthert said:
Michiel

What does it say that some people from Logica in the Netherlandsx tell
that?

I can make any benchmark to show that something is slow.

Cor

Michel Posseth said:
+ - One year ago i went to a MS seminar where LINQ was demonstrated ,
there were 2 persons from Logica who showed us how they used LINQ to SQL
in there projects , when one of the attendees asked them about the
processing perfomance instead of the RAD perfomance ( because that is
what they were focussing at ) they answered that they had contacted MS
about there findings and that this would in the near future be much
bether ! .

Then after some persuation from our side they showed there benchmark
application and it turned out that LINQ was teribly slow in comparisation
to traditional programming .

Ofcourse it could be that it is now much bether etc etc but AFAIK the
superb RAD perfomance of LINQ comes with the prize of less processing
perfomance
ofcourse in a project where you know this in forehand you can compesate
this with upscaling of your hardware it is in my opinion just what you
choose .

regards

Michel Posseth [MCP]



Lloyd Sheen said:
I'm just investigating Linq and it looks like it's a time saver for the
programmer. I'm wondering how the performance is if we want to use it
with our public websites?

We get an enormous amount of traffic. A while back we moved away from
gridviews on our public websites for the performance gain.

This is a good article that may help in your evaluation.

http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx

I have been using it for quite a while and it is very responsive.
Remember that Linq is not only for Database operations, you can use it
in many ways to process lists etc.

http://msdn.microsoft.com/en-us/magazine/cc700332.aspx
http://msdn.microsoft.com/en-us/magazine/cc793963.aspx

LS
 
I personally use LINQ and Generics a lot however when i have to process a
few million metering values ( because of my job as a production developer
at a energy billing company ) in the shortest amount of time i use the
fastest method and ofcourse the one that does not blow up in my face .
I would do exactly the same in this case, see my other reply in this group
about datareader.

The word energy did not come in my mind -:) so don't blaim me for that.

However, this is not a rule and I want to prevent that somebody calls it in
a while best practise to prevent Linq to Sql.

Cor
 
Cor ,

I had not read that reply from you on the datareader thread when i wrote my
example here
how funny :-)

Well i hope that evryone who is smart enough to code understands that the
terms "Best practise" , "Good coding practise" are a metafoor for "standard
industry coding style in the described situation" so this aren`t fixed
values they and can also change in the future due to new insights or new
methods in the framework .

But having read both threads now i know we share the same opinion

regards

Michel
 
Michel Posseth said:
+ - One year ago i went to a MS seminar where LINQ was demonstrated ,
there were 2 persons from Logica who showed us how they used LINQ to SQL
in there projects , when one of the attendees asked them about the
processing perfomance instead of the RAD perfomance ( because that is what
they were focussing at ) they answered that they had contacted MS about
there findings and that this would in the near future be much bether ! .

Is this linq to sql only? What is the reason performance is so slow? Afaik
it just translates your linq statement to sql and loads it into a collection
of objects using a data reader. So what is slowing it down? Are they
possibly talking about loading several data sets where the third collection
is loaded with 1 sql statement per line? If this is the case then that is
just their own stupidity for not writing better code.

Michael
 
Back
Top