I am using redgate performance profiler to test my asp.net mvc 2 application. One of the things I found out was the XMLSerializer was taking too much of the CPU time so referring from this post. I changed it to where it uses XmlSerializerCache
now.
Now the XmlSerializer issue is no longer there and I am profiling the application by simulating 80 users at the same time using the website with Jmeter. So now the top methods which take time are doing a FirstOrDefault()
on some data I am pulling I will give example-
var values=(from c in DataContext.Table1
join s in DataContext.Table2 on new { c.Id, c.date }
equals new { s.Id, s.date } into list
where c.Id== Id && c.date == date
from s in list.DefaultIfEmpty()
select new DayDTO()
{
Points = c.points,
Points1 = c.points1,
Points2 = c.points2,
Points3 = c.points3,
Points4 = c.points4
}).FirstOrDefault();
Can anyone suggest me what I can do to improve this ? The current times are 25 secs and 16 secs for the top 2 methods .. Is it just because I am simulating 80 user at the same time and there are some issues on database (sql server 2005) side like the table being too large and indexing etc...and I will look into that but currently I am trying to identify any issues you see with the code i.e. issues on C# side..
I would appreciate any help thanks !