I had 1/2 web application prepared. I had seen that the performance getting very slow when using the ajax control compare with using javascript but only when that is deployed on the server.
Why is this problem problem arriving when ajax controls used in application, performance sleeps & not opens the pages quickly.
What is the solution for this to improve performance when ajax control use & it deploy on the server.
Regards,
Girish
Yes.
Well, the reason it's slower when you deploy to the server is because the ajax requests now have to go over the entire internet. This is different compared to running locally, when the requests do not go over the internet.
How to speed it up?
Make less calls.
Return more things per call so you can make less in general
Return as little as possible, in a condensed format if possible
Consider enabling gzip on your server
other such things
Take a look at the improvements made for stackoverflow: https://blog.stackoverflow.com/2009/08/a-few-speed-improvements/
The other answers are good for general optimization, but I'm thinking there's an inherent problem with your understanding of the request flow in your application. For all intents and purposes, "ajax" is javascript.
The first and most important thing you can do is get Firefox and use firebug.
This will allow you to see what requests are made to the server, how long they take, and much, much more. This will give you a better understanding about the performance of the two different versions of your app.
You need to better understand your problem before we can really help you.
Consider using the ToolkitScriptManager instead of ScriptManager, it will merge all the requests for AJAX controls in a single request. This will increase the performance since there are less requests. Also, make sure that you have set the in the WebConfig when moving to the production server. When debug is set to true, the performance slows down dramatically.
Related
When designing a ASP.net WebForm application what are some important steps to take (or hacks if you like to use the term) to ensure the best possible performance (in terms of speed, stability, and scalability)?
Avoid round trips to server
Wherever possible user AJAX calls.
Implement Caching.
Avoid using Viewstate wherever possible
For further more read these links.
Improve Web Application Performance
ASP.NET Web Site Performance Improvement
Since so many things can affect performance, it's difficult to provide such a list. We may make assumptions about your code that aren't correct, and may focus on the wrong areas while you suffer poor performance from something we would otherwise take for granted.
Having said that, in general you might keep an eye on:
Don't over-use ViewState. (I'd argue not to use it at all, but that's another issue entirely.)
Keep page resources small (minified text, good image encoding, etc.).
Ensure page resources are properly cached once downloaded.
Try to move most UX logic client-side. (Avoid post-backs for things you can otherwise do in JavaScript, fetch data asynchronously where possible in small chunks, etc.)
The list can go on and on, and that's just with the web tier of the application. You could easily encounter site performance problems resulting from slow server-side code or server-side resource dependencies (database, etc.) that can't be debugged in the browser.
So the main point is to learn your debugging tools. Through combinations of browser tools (FireBug, Chrome Developer tools, etc.), Visual Studio debugging (or whatever else you may use for your .NET code), good logging, and even profiling tools you can identify your bottlenecks and tweak your system accordingly.
Check your website in google page speed :click
It will give your problem . for unwanted style.images and etc.......
If you care so much for speed, stability and scalability you might first question whether ASP itself is a good compromise
when it comes to performance of the web application we need to consider many things this article will help you understand what performance is where to start.
In web application 80 percent of the time it is front end which requires performance optimization, what needed to be optimized is a big question and really hard to answer
this article i found will help you understand the web performance optimization
Web Performance Optimization
The ASP.Net app (not MVC) is slow, someone heard that Jquery can speed things up by offloading work to the client.
Due to security reasons Jquery/Client can't make Web Service calls so squirrely ways of having the code behind making Web Sevices calls and passing data back to the client are being done to Jquery popups, Jquery gidviews, Jquery (fill in blank of existing server side control).
We've got Jquery AJAX going on along with Microsoft AJAX Update panels, which I'm worried about.
Question is: Are we really going to get a performance boost (which my gut says No) or are we on our way to a slower, more painful app performance?
Don't mix and match frameworks. It can cause problems and will certainly degrade performance. Choose one and stick to it. UpdatePanels are easy but will never be as fast as jQuery and web services.
http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/
I've never used the MS Ajax library but I have worked extensively with ASP.NET (webforms and MVC) and jQuery.
If this is an internal\intranet application or you don't need to worry about SEO, then using Ajax to pull content in will be fine. It will help your pages load and render in the browser quicker but your data still wont be available. You are really just breaking the hard work into several smaller components but the same amount of work is going to be done either way.
If you just care about getting a page rendered in the browser so that it doesn't feel (to the user) that its taking forever to load, then this is a great idea. If that isn't the ideal outcome, you might want to focus your efforts on figuring out why its taking so long to load data.
Can any help regarding the performance improvement in Asp.Net?The best practise tips for asp.net performance improvement?
This is a very broad question to answer because the Performance of an ASP.Net application is not only bound to page processing or bandwidth usage but also in the code and Algorithms you have written. If you use data source then the Performance of the Queries and ADo.Net. The Basic thing you might be asking is to improve page processing by Caching, etc..
Have a look here for a detailed description of Best Patterns and Practice (Though its old ..published in 2004 but still helps).
http://msdn.microsoft.com/en-us/library/ff647215.aspx
Or better consider this (For .Net4) . It list all performance related Documentation
http://msdn.microsoft.com/en-us/library/cc668225.aspx
Update
If you are looking for specific stuff slowing your page load
Use firebug's Net panel and monitor which resource is taking more time. Or as suggested by another answer use Tracing to check this out.
What is the best drug to get healthier? It all depends on what is your health problem. The same thing is with ASP.NET performance. First, find what is your bottleneck, a single most slow down factor. Then fix it, retest performance and, if more speed is necessary, go to the previous step.
How to find a bottleneck? If you really have no clue where to start, then start from analyzing your waterfall diagram. To create one from your client, use Fiddler or Firebug. To create it from different Internet geographies use WebPagetest. The waterfall will show whether the bottleneck is on the server or network, and also whether it is caused by main ASPX page or by resources (scripts, images, CSS). If the server and network are fast enough, then check slowness in the browser using Firebug or dynaTrace Ajax edition that can trace DOMContentLoaded/load events in browser. If the bottleneck is on the server, find out whether it is the database or application. Use database profiler and .NET profiler, for example from this question.
How to fix bottlenecks? Check this Microsoft resource, but there are many others for each type of bottlenecks.
If you add the “performance“ tag to your question you may get more answers.
Set trace="true" in the page directive. Reload the page and look for any obvious delays in the page life-cycle event handlers, particularly where you are accessing a database.
Also, use the Firefox Web Developer toolbar to obtain a friendly overview of the image file sizes and other static file sizes, CSS, JS, etc.
There are lots of questions and answers on ASP.NET performance here on Stackoverflow. Here's one of my previous answers and a quick search on the ASP.NET and Performance tags yields plenty of results.
What problems are you facing exactly?
what are the things a developer should keep in mind or should take care when depeloping a web application.
web application e.g. social networking web app.
which are the things which must be implemented to get good performance and scalability.
please provide any article or blogs or suggestions for this kind of question if you have
-thanks in advance
Some things that popped up in my mind
build in caching
keep code clean and (unit) testable
messure code coverage
optimize database with indexs and check execution plans
refactor every thing you build
optimize front end loading time (minification, gzip, compressing)
use source control
Deactivate Viewstate where you don't need it.
Most important:
Make sure to hold the amount of roundtrips as small as possible. Understanding the Life-Cyclus of an asp.net website is most important for that matter.
http://www.startvbdotnet.com/aspsite/forms/formlifecycle.aspx
I have an Ajax.Net enabled ASP.Net 2.0 web site. Hosting for both the site and the database are out of my control as is the database's schema. In testing on hardware I do control the site performs well however on the client's hardware, there are noticeable delays when reloading or changing pages.
What I would like to do is make my application as compact and speedy as possible when I deliver it. One idea is to set expiration dates for all of the site's static resources so they aren't recalled on page loads. By resources I mean images, linked style sheets and JavaScript source files. Is there an easy way to do this?
What other ways are there to optimize a .Net web site?
UPDATE:
I've run YSlow on the site and the areas where I am getting hit the hardest are in the number of JavaScript and Style Sheets being loaded (23 JS files and 5 style sheets). All but one (the main style sheet) has been inserted by Ajax.net and Asp. Why so many?
Script Combining in .net 3.5 SP1
Best Practices for fast websites
HTTP Compression (gzip)
Compress JS / CSS (different than http compression, minify javascript)
YUI Compressor
.NET YUI Compressor
My best advice is to check out the YUI content. They have some great articles that talk about things like CSS sprites and have some nice javascript libraries to help reduce the number of requests the browser is making.
If you are using Firefox to test your website, you might want to try a nifty Firefox extension from Yahoo! called YSlow.
It analyzes your web pages and provides grades from A-F (A being the Best and F being the worst) for each of the best practices, for high performance websites. It will help you to track down the elements of your website which you could optimize to gain speedups.
UPDATE
Now YSlow extension is compatible with all modern browsers such as Firefox, Chrome, Opera, Safari and others, read more here.
Turn viewstate off by default, it will be a night and day difference on even the most simple pages.
I wrote a blog post about improving ASP.NET page performance this a couple months back. Here are some quick & easy ways -
Turn off view state
Turn off event validation
Implement HTTP gzip/deflate compression to reduce the response size (number of bytes the server has to send back to the client)
Try to optimize/minimize your database calls for each request
I think you really need to be able to get some actual PerfMon data/telemetry from the app whilst running in production to be able to make an enlightened decision about what to optimise.
As a throw away tip I'd make sure your app is deployed as a Release build and set debug="false" in the 'compilation' section of your web.config.
You seem to be starting by assuming that your problem is download size - that may not necessarily be the case. You should do some experimentation with your ASP.NET site to determine if there are areas in your code which are causing undue delays. If it turns out that download size is not your problem, you'll need to find ways to cache your results (look into output caching, which is an ASP.NET feature) or optimize your code.
In any case - the first step when looking at a performance issue is always to verify your assumptions first, then decide on a course of action.
Have you tried these tips?
http://weblogs.asp.net/haroonwaheed/archive/2008/06/30/ASP.NET-Performance-Tips.aspx
You could start looking at caching strategies. Static files like CSS (even compressed ones) and images (even optimized ones) should only need to be downloaded once by the browser for a period of time.
Scirpt combining for AJAX has already been mentioned, but I didn't notice reference to the ScriptReferenceProfiler MS has released on codeplex to help figure out what to combine. Mike Ormond has a good start point on this.
Another tip if you're doing a lot of INSERTs to your database is to double check your server's disk caching is switched on. Case in point, I had an data importer doing 1.2 million inserts during a run. Took 4 hours and change without caching on. Took 16 minutes with it on.
A general thing when using ASP.NET and Ajax (any Ajax library) together is to avoid elephanting your Page_Load and Page_Init (and their method counterparts) things since these will be executing on every Ajax Request.
When that is said I would seriously ditch ASP.NET AJAX and use anything else...
Anthem.NET, AjaxPRO.NET, jQuery or whatever else than ASP.NET AJAX...
Of course I would use Ra-Ajax myself since that's my project. But then again I am biased...
You could turn on compression based on your client supporting it. See this article: link text
Static resources shouldn't be resent unless changed. IIS will send a response code which tells the browser to use the cached version.
You could also look at ASP.NET output caching, which can be applied fairly granularly to different portions of your page:
http://msdn.microsoft.com/en-us/library/xsbfdd8c(VS.71).aspx