Strange performance issue

I have a strange performance issue and have no idea how to find the bottle neck. A page on my site (Premium Domain Broker - DNX.com) is taking way too long to load. So I decided to test it out via curl to see how fast it was downloading the page and this is what I got:

ben-johnsons-macbook-pro-17:neco-website benjohnson$ time curl -o output.txt Premium Domain Broker - DNX.com % Total % Received % Xferd Average Speed Time Time Time Current                                 Dload Upload Total Spent Left Speed 100 955k 100 955k 0 0 198k 0 0:00:04 0:00:04 --:--:-- 251k

real 0m4.954s user 0m0.018s sys 0m0.077s

5 seconds for a page that size is not too bad. But in the browser is takes around 15 seconds to load. Are there any tools I can use to determine was part of my layout is taking a while to load? Because the browser seems to work VERY hard to display that page. Why is the browser working so hard? Our competitors sites (ex: http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/) have pages with more tickets that load faster and their pages are actually bigger in size. I'm just really frustrated and confused.

Any help is greatly appreciated.

Also, you can see a significant speed decrease for our competition:

ben-johnsons-macbook-pro-17:neco-website benjohnson$ time curl -o poo.txt http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/ % Total % Received % Xferd Average Speed Time Time Time Current                                 Dload Upload Total Spent Left Speed 100 613k 0 613k 0 0 52750 0 --:--:-- 0:00:11 --:--:-- 53612

real 0m11.920s user 0m0.016s sys 0m0.054s

Yet, their page loads much faster in the browser, and takes twice as long to download. Really weird. Here are the 2 URLS, try for yourself:

http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/

Ben,

Your main page itself is loading in less than a second. It's all the other stuff on the page that's causing problems.

Use Firebug's net tab to see all the stuff your page is loading. Use YSlow to get some pointers on how you aren't exploiting HTTP well. Both are Firefox plugins you'll soon find indispensable :slight_smile:

1. You aren't bundling your assets. For example: <%= stylesheet_link_tag :all, :cache => "cache/all" %> to generate a single public/stylesheets/cache/all.css 2. You aren't setting an Expires header on your assets. Every page request has to hit the server for every image, javascript, and css file. Setup an Expires header long in the future so they're never re-requested until the file itself changes. 3. The only thing in your app that's too slow is seats.xml. Speed up that action or cache it.

But most of all, get friendly with Firebug and YSlow!

Good luck, jeremy