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

  • SEARCH
  • Home
  • 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 4539726
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:59:12+00:00 2026-05-21T14:59:12+00:00

Q: In my previous work with asp.net , all what i think about is:

  • 0

Q:

In my previous work with asp.net , all what i think about is: how to do the required task any way.i don’t care about performance, but now i think , I’m supposed to focus on the performance issues after i have learned a lot concerning how to deal with this language to some extent.

when learning the concepts and the syntax , my instructor told me, that the performance issues are not so important , the priory always is to do the required task in time.and the great revolution in the hardware and network infrastructures will save the performance gap you leave in your code!.

Now I want to know some tips (Do and Not To Do) concerning the performance issues in asp.net and the web in general.i will be grateful if there is some example about the idea.

for example : i had been told that:

int count = dataTable.Rows.Count;
for(int i = 0 ; i<count ; i++)
{
   //Do some thing
} 

is more performant than:

for(int i = 0 ; i<dataTable.Rows.Count ; i++)
{
   //Do some thing
} 
  • 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-21T14:59:12+00:00Added an answer on May 21, 2026 at 2:59 pm

    Simple: don’t optimise prematurely. And in this case, that is premature. There is a subtle difference between hoisting the length vs querying it each time, but in any sane circumstance, a: we’re talking nanoseconds if that, and b: it changes depending on whether it is a naked vector, a list, an ilist, etc. Don’t learn a general rule.

    But the bigger problem here: that specific example is absolutely irrelevant to overall performance; you are talking about a DataTable; a DataTable presumably that is being populated from a database, which is out-of-process, and probably on a different machine. You are comparing nanoseconds (possibly less) against network latency (normally 0.3ms on a local LAN) plus query time, plus bandwidth (depends on the query).

    You can’t change the speed of light (latency), but you can write an efficient data query that accesses only the required data, using appropriate indexing and possibly denormalization. Oh, and N+1 – that’s a biggie.

    Likewise, even in memory – most bottlenecks tend to be due to things like inappropriate looping (when a hash-based lookup would be better), or not using appropriate caching to remove the need to constantly query data over and over and over and over and over.

    On “the web in general”; caching, compression (transport and content – for example js/css minification), cookie-free domains for static content (maybe a CDN), farms of servers, fat pipes, and proper CPUs…

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

Sidebar

Related Questions

I do understand SQL querying and syntax because of previous work using ASP.NET web
After seeing a previous post Making Applications programmed in .NET languages work on older
This is similar to my previous question but it didnt work with the Kindle
Previous working asp.net webforms app now throws this error: System.MissingMethodException: Method not found The
I have successfully implemented my GridView now, but, as always, the whole ASP.NET life
Question: Is there a way to detect what XHtml conformance setting a particular ASP.Net
I have been learning to develop websites using ASP.NET MVC 2 for work... and
now that I've resolved my previous issue with clickatell: Impementing Clickatell CallBack in ASP.NET
I am working on asp.Net, and i am required to build a costing calculator
I spoke about this in a previous question, but I have since narrowed down

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.