views:

18

answers:

0

I have a test bed that I created while evaluating EF4's Self Tracking Entity capabilites vs our current ORM tool (LLBLGen Pro). One of our usage scenarios produced significant performance differences. EF4 in general looked very promising, but this potential performance problem (and concern raised by it) make me very reluctant to sign up for the long haul.

Scenario: 1) 4 objects in graph one Many2Many associative object. 2) Using EF4 Self Tracking Entities 3) The many2many associative object has fairly high cardinality (100,000 rows) 4) other objects in graph had relatively low cardinality (200, 100 and 10) if I remember correctly 5) Prefetching entire object graph due to working in disconnected environment

domain model image = http://www.freeimagehosting.net/uploads/9dd695812b.jpg

    /// <inheritdoc/>
    public IList<TestOrderCarrier> GetAllTestOrders()
    {
        using (var context = new InstServerEntities())
        {

            var testOrderCarriers = (from o in context.TestOrderCarriers.Include("TestOrderAliquots.TestOrderAliquotAssays.TestOrderAssay") select o);

            return testOrderCarriers.ToList();
        }
    }

Results: LLBLGen Pro = 4 seconds to return fully populated object graph EF4 = 39-53 seconds to return the fully populated object graph

For additional reference point used Microsoft's Linq2Sql lightweight ORM and it was 2.5s to return the full object graph.

My question is has anyone seen this sort of performance issue? Any thoughts on how to resolve it?

I have a full test bed I can provide including the populated database, but I don't see a way to post it (nor should i probably since it is 15mb).

DaveW