performance in LINQ

C

ck1

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;
 
H

Hans Kesting

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
 
J

Jon Skeet [C# MVP]

ck1 presented the following explanation :




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
 
C

ck1

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;
 
J

Jon Skeet [C# MVP]

ck1 said:
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.
 
P

Pavel Minaev

ck1 said:
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.
 
C

ck1

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;
 
P

Pavel Minaev

ck1 said:
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.
 
C

ck1

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top