Web developers always say it’s important to speed up a site. Either cut the size of an image, or minimize requests.
Why should we? Everyone has a broadband connection and a fast computer. Why worry about an extra second or two?
First, it’s never just worrying about a second, it’s sometimes worrying about cutting a few milliseconds off a page load. Eliminating 1 HTTP request.
Fixing site perforamance is just as important as doing proper SEO. If you do all the SEO work in the world, Google won’t want to index a slow site.
We’re all web developers here right?
Most of us?
At least, I am.
An article posted at DrunkenFist.com, Why Front End Performance Matters to Everyone, Not Just the High Traffic Giants, goes into why front end performance is important on all sized sites.
The article quotes a commonly spoken theme in web development:
That stuff is for the Googles of the world. We don’t really need to focus on that with what we do.
I hear it all the time from people. That there isn’t a need to worry about that 35k 120×120 JPEG on the home page. Lets make it animate, even if the single function adds 28k to the page download.
What sticks with people is hearing that when google shaves off some small amount of file size, the result is something like $50,000 / hour in return. This number is made up, but meant to illustrate a point. To small store owners, $50,000 is a large number. To google, it is very small. Small business will possibly realize a few dollars a month with extensive optimization, assuming their hosting plans are even based on that at all.
What’s the point in optimization if we only make a few dollars a month?
The end user experience. The user experience is not quantifiable in terms like “$10 / hour”, it is just as important. A faster web page, more solid web page, reflects the business itself.
If a company is always interested in making all of their processes more efficient, then it is more likely that whatever they do for revenue has the same types of optimizations. Over years, optimizations can become quite dramatic.
If this year a website only gets 1000 visitors, and of that only 10 of the users realized the benefit of the optimization — that doesn’t mean much. However, what if one of those 10 users just happens to run a blog in your industry?
The point of all of this, front end performance is important. You can almost always improve the user experience.
As an exersize try to build a standard webpage with a miniscule allowed footprint. I’ve always had the most fun with flash banner ads that must fit into 10k or 20k file sizes. You will gain an understanding of what you are working with, and become more of a craftsman in your work.
Flash banner customization has helped me understand the following skills:
- Embedded fonts — picking which letters to embed and fonts to embed
- Sometimes vector art in Flash is much more efficient than imported graphics
- Sometimes vector art in flash is NOT as memory efficient as imported graphics
There are always tradeoffs in everything we do. Until we push our work to the edge, we rarely see how to control it.
I’m going to be writing up a tutorial and exploring the benefits of what I am about to propose, this is for conversation and discussion.
When creating MovieClip objects that update their status every frame they enter, traditionally you bind a general loop to their “onClipEvent(enterFrame)” or other methods to bind to the onEnterFrame method.
Inside is normally a loop that executes perpetually with each frame refresh. When objects build up with this logic, the framerate in Flash movies can dwindle. This is especially evident on slower functioning computers.
I will be testing out a method to enhance movieclips who don’t need to always be looping. For example, if you have a navigational structure with 3 elements. Lets call them Home, News, and Contact. These navigational elements need to animate themselves when told to do so by the main flash animation.
Normally I would bind a method to “setTargetXY”, “doAnimation”, and let the main handler “onEnterFrame” handle the animation from there.
But what about when the movie isn’t moving the navigation around?
I propose the doAnimation should always have a “this.start()”. Additionally when the animation is over, the main handler should “this.stop();” to stop the moving from entering frames and continuously checking for an “isActive” or other qualifiers to begin animation calculations.
I’ve informally done this before just out of optimizing code, but I think a more formal approach may be beneficial.
Does anyone know if the flash player automatically does this? Tests for logical qualifiers in movie loops, and stops them until those qualifiers change?
It could be a nice optimization to the way Flash player handles static objects who have a loop with a single if statement wrapped around.