collection loading performance

Posts   
 
    
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 04-Nov-2005 21:09:02   

I use selfservicing and am loading a collection with a get multi that will return around 63000 records. If I pull the llbl gen query this runs, and run it in query analyser, it returns data in around 4 seconds. The get multi takes almost 27 seconds to run though. Is there any way to speed this up? We have prefetch paths off.

There is a single inner join via a relationship to another table also. The join is on 1 field, the primary key to foreign key of the other table.

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 05-Nov-2005 12:04:05   

Before you start fetching data into the collection do: collection.DoNotPerformAddIfPresent = false;

(new property in 1.0.2005.1)

This should speed things up. However keep in mind that loading a lot of entities into a collection can be alittle slow sometimes, partly due to network traffic issues in case of blobs and because the current structure of the entity fields objects (which contain their own info inside of them) has some overhead which is a bit slower than fetching it into a datatable for example (fetching a datatable simply places the object[] array received from datareader.GetValues into the datatable as a datarow)

Frans Bouma | Lead developer LLBLGen Pro
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 07-Nov-2005 15:12:13   

Thanks that made it much better Guess I should read the entire manual... flushed

jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 07-Nov-2005 16:00:23   

Here are some numbers for an FYI if anyone needs them

First time user pushes search button: Old way without the mentioned method: 11.4 seconds New way: 9.7 Seconds.
Around a 15% gain.

This isn't bad, but the real benifit came in when they pushed search again with an already full collection.

This went from 111 seconds to 9.6 seconds.