themolotov.net


Skip To Content

I Have A Problem: Optimization

The site loads quite a bit faster according to metrics, but how does efficiency affect design decisions?

I realized today that I have a problem: I'm addicted to optimizing things. I've known for a while that I loved doing it, but I didn't realize until today that it was actually a problem.

Optimizing

Today I was optimizing some things on my site and went through some PHP stuff. I fixed a few things but realized that my script is generated in hundredths of a second, so my efforts would be better spend optimizing the download times. I should have started there actually; it doesn't matter if your script is generated in 0.03 seconds if it takes 5 seconds to download the HTML, CSS, Javascript, and other junk that displays your information. I did an analyses using this optimization tool and this timing tool. I noticed that my CSS and JS files were being enormous hogs. Supposedly, linking to external CSS files is faster, but I'm not so sure; more in a bit (pun definitely intended). While compressing and trimming, I felt pangs of guilt for destroying perfectly legible code to increase results. It seems a sad and almost unecessary trade-off to reduce legibility for slight gains in load times and bandwidth consumption.

And then I saw my results.

I was blown away. My filesizes, just from removing whitespace (newlines and tabs) was cut in half. My page load times pretty much halved. I noticed something curious though when using pingdom.com's tool: When I submit themolotov.net, the page loads in 0.7 seconds, but when I send it directly to themolotov.net/index.php it loads in only 0.4 seconds. Could Apache really take that long to serve up the index page? I'm on shared hosting, so that might be an issue (busy server), but it makes me more inclined to start linking to the index page instead of the top of the domain.

So where are my problems? According to these tools, half of the time it takes to load my page is parsing the PHP, connecting to the database, then parsing my template files with the information. I'm not concerned with the template stuff - I forced recompiling them and they have been re-cached by the server already. The problems lie in my CSS and JS files. My CSS file is just relatively large. I could just paste the CSS into the headers of my pages, but while lowering initial download times, it would increase download times across the board. Then there is the Google urchin.js file. According to these tools, it takes longer to connect to Google, and start getting the file than it does to actually download the file. Also amazing: the urchin.js file is 5 times the size of my CSS file, but downloads in half the time.

The Problem

While looking at all these times and sizes and stuff, I felt myself get irritated that the Google tracking JS was about 20k. Is that too far? It's hard for me to tell. I realize that 20k is nothing to broadband people downloading up to 500k a second, but I think at this point it's beyond speed - it's just huge compared to the size of everything else; at least twice as large as the entire page. Granted, this is a one-time rendering of my main page (though, checking an entry page nets the same result), times and such will increase just with the posting of this entry (see the images tacked on to those links? Yup, another HTTP request and another download, albeit minute). I can't help but wonder how this affects how I design pages. I know that I'm able to create visually rich pages; I've done it. Because this is a personal page, how is my subconscious affecting my choices? My desire for efficiency and optimization might be shining (or burning?) through in the form of minimalism. Maybe I'm looking at the wrong side of the coin though; What if instead of pursuing optimization and efficiency because I like the minimalist approach, I pursue the minimalist approach because of my inherent draw to efficiency? I suppose it doesn't matter, really, but I find myself making whacky design decisions based on load times and such.

I'm not kidding myself. I don't think it really shows on a site of this caliber (currently!), but I'd like to think that when I'm working on a client's site that my eye for efficiency will help them out a lot.

Perhaps what separates great designers from regular designers is the ability to stuff a bandwidth pipe with fantastic designs very efficiently without making trade-offs.

this entry

Mood: Curious
Music: Imogen Heap
Location: work



You are not able to comment on this entry.



All Content Copyright Jon Gartman 2006, unless otherwise noted.
This site is part of the molonet. Generated in about 0.553 seconds.
Spiral out, keep going.