locked
MIcrosoft Enterprise library - Slowness in results.ToList<Entity>(); took 15S to cross this line RRS feed

  • Question

  • User-2036860069 posted

    Dear Team,

    We are using enterprise library with object data scource event on the telerik radgrid. Currently we are fixing performance related fixes. but the below highlighted line took more than 15S to cross. Is it possible to do it within a second.  Quick help would be much appreciated.

    results = db.ExecuteSqlStringAccessor<ProfileProjectDetails>(transaction, sql);

    List<Entity> resultsList = null;  

    if (results != null){ resultsList = results.ToList<Entity>();} - This line took more than 15S to cross.

    Thanks

    Deepan.

    Thursday, November 19, 2015 9:02 AM

All replies

  • User753101303 posted

    Hi,

    15 seconds is meaningless without knowing how many elements you are reading. So my first thought would be just retrieving too much data. See also if you could have blob columns such as a long text or an image). You could also test what happens for a single line to aghve a rough estimate of your network performance.

    Not directly related but I'm failry sure the returned value is never null (it should return an empty list if no data is found) so the results!=null is likely always true anyway.

    Thursday, November 19, 2015 1:05 PM
  • User-2036860069 posted

    Hi,

    Thanks for your response. 15 columns with 50 rows itself is taking time to cross that line. Also the column length is very short not too big. So is there any other code can we use instead of results.ToList<Entity>()>.Basically we need some performance on this line when we debug and this line took approx 10S to cross.

    Friday, November 20, 2015 2:19 AM
  • User753101303 posted

    Ok so is this solved? It would be the line which is really slow between the web and the db server? They are not at the same location?

    Friday, November 20, 2015 3:01 AM
  • User-2036860069 posted

    No this is not solved. There is no DB hit in this line .We are just converting the items into Entity list.

    Friday, November 20, 2015 7:36 AM
  • User753101303 posted

    ToList should trigger a db call (not using it but  I assume it is similar to EF?). You convert what you got from the db. BTW what happens if you compare a simple ToList() call with a ToList<Entity> call? Does it make a difference in speed?

    Friday, November 20, 2015 12:50 PM
  • User-2036860069 posted

    Not sure. We are using enterprise architecture and this is inbuilt code. As per Microsoft practices and patterns ,ENT.LIB used this code by default. Can  anyone please suggest why are we having slowness in this code.

    Thanks

    Deepan.

    Monday, November 23, 2015 12:12 PM