This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I've been profiling our solution and it seems that Data binding of 100 entities to a ListView on an .aspx page takes a huge amount of server time. Any ideas on how I can make this run faster? Is this an appropriate way to show/fetch so much information? |
|
|
The first thing to do is set LightSpeedContext.Logger = new TraceLogger() and see what queries are going on to the database. It's possible one of your columns is causing an association to lazy load, which would cause an n+1 problem. If that doesn't point up anything obvious, let us know and I'll bring in one of our ASP.NET guys. |
|
|
It turns out we aren't using EntityDataBindingItems to BindData. Could this be a problem? |
|
|
Ok, will do. |
|
|
Hi Edward, First I would review the log output as Ivan suggested to understand what queries are being executed when you bind the data. If you are traversing lazy associations on your list of entities (possibly across multiple associations) then this will be triggering per entity loads as required which may result in an extremely large number of queries and correspondingly a long time to load the data. If this is the case you will want to eagerly load the data in before binding the data to the list. If this isnt the case then could you provide some more details about your model and what the binding operation is going in terms of pulling data out of your model (and what the trace output from the logger looks like).
Thanks! Jeremy |
|
|
We found 4000 calls to save changes in some code which was causing a spike the first time a user loaded a page. This is because we added a new nullable value (which counts the number of messages) to our DB so we have to check if it is null, calculate it and save the resulting value to the database. We will get on to fixing this soon, but the DataBind() itself is still taking a large amount of time. I will look in to eager loading of the values as I think this may be the problem. |
|