Speed up by conversion?

I have a website in asp that queries many sql tables and stored procedures and is loading extremely slow. Would it speed up its load time if I went ahead and converted this to an MVC format using entity framework and used linq for the queries?

2 answers

  • answered 2018-02-13 01:04 Jonathan Wood

    No. MVC vs whatever mystery platform you are using now has nothing to do with the speed of accessing your database.

    Of course, one database query is faster than many. So if you can reduce the number of trips to the database that will likely be the way to speed things up. Other than that, you haven't provided near enough information for anyone to help tell you how to speed things up.

  • answered 2018-02-13 01:53 Scott Hannen

    Without knowing the details, here are few possible areas that might improve the load time, specifically related to data that takes longer to retrieve.

    1) Cache what you can. If any of those 35 database calls aren't user-specific then you shouldn't need to make them on every page load. That's not going to help much for your initial page load but it will after that.

    2) Prioritize. Suppose one of those 35 queries is user-specific and can't be cached, or maybe it's not user-specific but it's just real slow. Is it possible that your page could load without that data, and then make an AJAX call to retrieve it? Perhaps your users would be happier seeing most of the page load even if part of it takes a little longer.

    Also, AJAX requests can be cached by the browser. So while it may not be practical for you to cache a lot of user-specific data, the users' browser can cache it and not make a request to your application every time. That's an advantage you get with partial page loading.

    Page load time is a little bit about perception. For example, you might notice that the page you're on right loads quickly. But you'll also see that some content loads half a second or more later. The ads load last. It wouldn't seem nearly as fast if you had to stare at a blank page and then the entire completed page was rendered at once.

    3) As mentioned, see which of these database requests can be combined. But don't combine data which is user-specific with data that isn't. That goes back to caching. If one SQL call returns user-specific data and "general" data then you have to execute everything every time. If you separate them then you can cache the general data and only request user-specific data.

    IMO it's marginally easier to do AJAX calls and partial page loads with an MVC app then with ASP.NET WebForms. But that's just a personal opinion and certainly not a good reason to rewrite an entire app.