Fun with JavaScript Profiling, Minification, and JSLint

I’ve been working with JSLint profiling and what they say is true: minification is more efficient if you write your JavaScript following certain JavaScript sub-standards (I know there’s a better way to phrase that).

File Sizes

Original: 27,542 bytes
Original (minified): 21,179
Linted: 30,714
Linted (minified): 20,899

Here’s the scoop. The original file size was 27,542 bytes. When rewritten using Crockford’s “Good Parts” settings in JSLint the file size grew to 30,714 bytes (by ~12%). The original file size minified to 21,179, a savings of 6,363 bytes (~23%).

Here’s where it gets cool.

Linting the file added 3,172. But doing so allowed the compression to reduce the file size to 20,899 bytes, shrinking it by 31% and making it even smaller than the original file was when it was minified!

Awesome and weird, right?

Published by Thomas Guy

Everybody dance. Everybody dance, now.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.