PC Review


Reply
Thread Tools Rate Thread

performance in LINQ

 
 
ck1
Guest
Posts: n/a
 
      31st Aug 2008
Hi at all - I want to know if there are diffirence with
Liqn to SQL and Linq To entity performance.

I have read many article on the web that say that Linq To Entity
is more fast than Linq To Sql.

What is your experience about that ?

ck1;
 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      1st Sep 2008
ck1 presented the following explanation :
> Hi at all - I want to know if there are diffirence with
> Liqn to SQL and Linq To entity performance.
>
> I have read many article on the web that say that Linq To Entity
> is more fast than Linq To Sql.
>
> What is your experience about that ?
>
> ck1;


I don't have any experience yet, but it doesn't surprise me: Linq to
SQL calls the database, which is much slower than in-memory calls
(which Linq to objects does).

Hans Kesting


 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      1st Sep 2008
On Sep 1, 2:48*pm, Hans Kesting <news.han...@spamgourmet.com> wrote:
> ck1 presented the following explanation :
>
> > Hi at all - I want to know if there are diffirence with
> > Liqn to SQL and Linq To entity performance.

>
> > I have read many article on the web that say that Linq To Entity
> > is more fast than Linq To Sql.

>
> > What is your experience about that ?

>
> I don't have any experience yet, but it doesn't surprise me: Linq to
> SQL calls the database, which is much slower than in-memory calls
> (which Linq to objects does).


Note that the OP is talking about LINQ to Entities, aka the Entity
Framework - much more directly comparable to LINQ to SQL than LINQ to
Objects is.

Personally I think the difference between LINQ to SQL and the EF is
likely to very much depend on exactly what you're doing. A general
statement is likely to be wrong for a great number of situations.

Jon
 
Reply With Quote
 
ck1
Guest
Posts: n/a
 
      1st Sep 2008
basically i need to create a little Web application:
it's like a blog.

So i think that i can see 1000-2000 users,
every user can have 300 message in 1 year.

I have no complex relation, but very amouth
of query (insert, select).

What i have see is that Entity Framework
isn't serializzable very well. Linq To SQL
have better serializzation.

I suspect that Entity Framework is great
but more great for little application
like website, forum, blog, etc, where linq to sql
it's so better.

But i haven't used so well Entity Framework for say
that... any help ?

ck1;
 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      1st Sep 2008
ck1 <(E-Mail Removed)> wrote:
> basically i need to create a little Web application:
> it's like a blog.
>
> So i think that i can see 1000-2000 users,
> every user can have 300 message in 1 year.


In that case do you really care about the performance? That's likely to
be a pretty tiny database - I doubt that you'll have issues using
either LINQ to SQL or the Entity Framework.

I've used LINQ to SQL for csharpindepth.com - partly because EF wasn't
out when I wrote it - and found it very easy. I believe EF is a more
"enterprisey" solution, but it's probably worth learning both in the
long run.

--
Jon Skeet - <(E-Mail Removed)>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
 
Reply With Quote
 
Pavel Minaev
Guest
Posts: n/a
 
      2nd Sep 2008
> ck1" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> What i have see is that Entity Framework
> isn't serializzable very well. Linq To SQL
> have better serializzation.


What do you mean by "better serialization"? No meaning I can think of makes
any sense in this context.


 
Reply With Quote
 
ck1
Guest
Posts: n/a
 
      2nd Sep 2008
> What do you mean by "better serialization"? No meaning I can think of makes
> any sense in this context.


I have try to use a gateway in order to take the result of the Assembly.

The gateway is Weborb:
http://www.themidnightcoders.com/weborb/

But when i try to get some result complex, like a Order that have more
OrderDetail, i receive an error (cpu at 100%).

If i disable the OrderDetail relation, all work fine.

I have found that is't a serializzation problem:
with Linq to Sql all work fine.

With Entity Framework, cpu at 100% and error "serializzation".
So i think that EF don't work so well with middleware.

ck1;
 
Reply With Quote
 
Pavel Minaev
Guest
Posts: n/a
 
      2nd Sep 2008
"ck1" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>> What do you mean by "better serialization"? No meaning I can think of
>> makes any sense in this context.

>
> I have try to use a gateway in order to take the result of the Assembly.
>
> The gateway is Weborb:
> http://www.themidnightcoders.com/weborb/
>
> But when i try to get some result complex, like a Order that have more
> OrderDetail, i receive an error (cpu at 100%).
>
> If i disable the OrderDetail relation, all work fine.
>
> I have found that is't a serializzation problem:
> with Linq to Sql all work fine.
>
> With Entity Framework, cpu at 100% and error "serializzation".


I'm still confused. Are you trying to take an object graph consisting of EF
entities, and serialize it to XML (perhaps implicitly by using some
framework that exposes it via a Web Service)? If so, you might want to share
details regarding the error message that you get - it might be just a
misconfiguration issue.

On a side note, to conveniently access EF models from client-side
JavaScript, can use ADO.NET Data Services - that's precisely what it is
about.


 
Reply With Quote
 
ck1
Guest
Posts: n/a
 
      2nd Sep 2008
> I'm still confused. Are you trying to take an object graph consisting of EF
> entities, and serialize it to XML (perhaps implicitly by using some
> framework that exposes it via a Web Service)?


It's a binary serializzation.
Weborb can call directly the 'assembly'.

> If so, you might want to share
> details regarding the error message that you get - it might be just a
> misconfiguration issue.


I have a error detail from .Net;
the only error that i have is CPU at 100%
and "serializzation error" in the Weborb log.

It's a mistake, but i can't use EF with Weborb
but i can use Linq to Sql with Weborb.

Same Linq query, same Database.

> On a side note, to conveniently access EF models from client-side
> JavaScript, can use ADO.NET Data Services - that's precisely what it is
> about.


I think that Weborb team need to create a new version in order to
support Entity Framework, because actually there are a lot of problem
with serializzation.

With Adobe Flex, it's better to use Weborb: i can't use ADO.NET data
services.

So my conclusion: Linq to Sql it's better to serialize than Entity
Framework.

If you want to try be yourself, download the free version, and call
the Assembly that you want by the CONSOLE (no code to write...) and
your CPU will go at 100% if you use Entity Framework.

ck1;

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linq or not Linq George Microsoft ASP .NET 4 5th Nov 2008 05:53 PM
Combination of Linq to sql and Linq to xml ph_haenggi@yahoo.de Microsoft C# .NET 1 7th Aug 2008 08:20 AM
Mixing linq to sql and linq to xml (in linqpad) timor.super@gmail.com Microsoft C# .NET 2 11th Jul 2008 12:05 PM
Linq to SQL - Return DataTable as a result of Linq query szwejk Microsoft C# .NET 3 1st Feb 2008 04:07 PM
In Orcas Linq, When does it happen to convert LINQ to SQL command =?Utf-8?B?UGV0ZXI=?= Microsoft ADO .NET 0 30th Aug 2007 02:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:29 AM.