-
JavaScript Perfromance Tip- Don’t Test Against obj.length. Test Against a Local Variable.
I saw it yesterday in some code I was debugging and I realized I’ve become hyper sensitive to this common pattern: var anchors = document.getElementsByTagName(‘a’); if (anchors.length > 0){ for (var i=0; i < anchors.length; i++) { addEvent( anchors[i], 'click', trackLinks ); }; }; Why am I sensitive to it? Well, what are some of…
-
An Update on My URL Shortener
The difference in speed between my day job and the after hours hacking I do is sometimes mind-boggling. My day job is a typical “day job”. Anything of note takes time to happen. I’m cool with that. I’m also cool with what happens at home. Where I can get an idea, hit Google for some…
-
Setting Up My Own URL Shortening Service
As I recently mentioned (on Twitter, does that really count?), I’m not a fan of URL shortening services. I don’t like the idea of trusting the value of links pointing to my sites to a third party. Especially since the URL shortening space itself is so sketchy. With that in mind, it was with interest…
-
How Difficult Is It To Avoid Expensive CSS Selectors?
I’ve read all the articles and I’m still compelled to write rules like this one I wrote earlier tonight: #main-menu .primary a{ color:#7b0000; } I know I’m not alone in using rules like that. It’s a super common pattern.
-
Even Faster Web Sites (Review)
I finally finished reading Even Faster Web Sites. It’s good, but in terms of things for my day to day, it’s kind of a mixed bag. In some ways (specifically in the areas of JavaScript efficiency, image compression and CSS selectors) it’s more practical than High Performance Web Sites and in others I had a…