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 115091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:57:52+00:00 2026-05-11T02:57:52+00:00

What is the fastest way to execute a method on an ASP.NET website? The

  • 0

What is the fastest way to execute a method on an ASP.NET website?

The scenario is pretty simple: I have a method which should be executed when a web page is hit. Nothing else is happening on the page, the only rendered output is a ‘done’ message. I want the processing to be as fast as possible.

Every single hit is unique, so caching is not an option.

My plan is to use an HttpHandler and configure it in web.config (mypage.ashx) rather than a regular .aspx page. This should reduce the overhead significantly.

So my question is really: Is there a faster way to accomplish this than using HttpHandlers?

  • 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. 2026-05-11T02:57:52+00:00Added an answer on May 11, 2026 at 2:57 am

    Depending on what you’re doing, I wouldn’t expect to see a lot of improvement over just using an HttpHandler. I’d start by just writing the HttpHandler and seeing how it performs. If you need it to be faster, try looking more closely at the things you’re actually doing while processing the request and seeing what can be optimized. For example, if you’re doing any logging to a database, try writing to a local database instead of across a network. If it’s still not fast enough, then maybe look into writing something lower level. Until that point though, I’d stick with whatever’s easiest for you to write.

    For reference, I’ve written an ad server in ASP.NET (using HttpHandlers) that can serve an ad (including targeting and logging the impression to a local database) in 0-15ms under load. I thought I was doing quite a bit of processing – but that’s a pretty good response time IMHO.


    Update after several months:

    If you clear all the HttpModules that are included by default, this will remove a fair amount of overhead. By default, the following HttpModules are included in every site via the machine-level web.config file:

    • OutputCache
    • Session (for session state)
    • WindowsAuthentication
    • FormsAuthentication
    • PassportAuthentication
    • RoleManager
    • UrlAuthorization
    • FileAuthorization
    • AnonymousIdentification
    • Profile
    • ErrorHandler
    • ServiceModel

    Like I said above, my ad server doesn’t use any of these, so I’ve just done this in that app’s web.config:

    <httpModules>    <clear /> </httpModules> 

    If you need some of those, but not all, you can remove the ones you don’t need:

    <httpModules>    <remove name='PassportAuthentication' />    <remove name='Session' /> </httpModules> 

    ASP.NET MVC Note: ASP.NET MVC requires the session state module unless you do something specific to workaround it. See this question for more information: How can I disable session state in ASP.NET MVC?

    Update for IIS7: Unfortunately, things aren’t quite as simple in IIS7. Here is how to clear HTTP Modules in IIS7

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

Sidebar

Ask A Question

Stats

  • Questions 79k
  • Answers 79k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I find that comment very useful as it points out… May 11, 2026 at 4:01 pm
  • Editorial Team
    Editorial Team added an answer Have a read of this documentation which explains how linq… May 11, 2026 at 4:01 pm
  • Editorial Team
    Editorial Team added an answer If I'm reading this right, you're missing the datasource for… May 11, 2026 at 4:01 pm

Related Questions

Last week I wrote a few lines of code in C# to fire up
What is the fastest way to share data structures between Java and C#? I
What is the fastest way to find out whether two ICollection<T> collections contain precisely
What is the fastest way to load data from flatfiles into a MySQL database,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.