Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3484734
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:49:22+00:00 2026-05-18T10:49:22+00:00

I am using redgate performance profiler to test my asp.net mvc 2 application. One

  • 0

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 !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:49:23+00:00Added an answer on May 18, 2026 at 10:49 am

    This assumes that the top time is the “inclusive time”, not the “exclusive time”.

    Inclusive time means that it includes any code called by the method, in this case the FirstOrDefault will execute the database call. Database calls are expensive in the context of latency, but the CPU thread is blocked and not using the CPU while waiting for the database call.

    First you should ask yourself if this is a problem, it does not significantly affect throughput (assuming the database server can handle the load), but latency of your calls.

    If this is a problem you need to speed up the actual SQL query. You should start SQL profiler, catch the actual question, then run it in SQL management studio. Look at the execution plan to see if the query is slower than expected and try to figure out why. If it is too slow you might check your indexing to start with.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET MVC there are situations (such as form submission) that may require a
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Has anyone else had issues using Redgate's .NET Reflector on Windows 7 Ultimate 64-bit?
Here is my dilemma, I am working on some SaaS using ASP.net MVC3 and
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
I need to improve memory performance on my application and I could see that
I have been using SQL Compare by Redgate at my company and was very
Quick question. Can I recover a lost .cs file using RedGate Reflector ? My
Using online interfaces to a version control system is a nice way to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.