What is the best way to pack JavaScript code without getting perfomance flaws?

What is the best way to pack JavaScript code without getting perfomance flaws?

I am searching for a way to compress JavaScript code for the iPhone. Is there a way to avoid using a lot of CPU time on the small and rather slow device?

iPhone API get local device phone number [duplicate]


Getting the local iPhone number through SDK
Use JSMin and avoid packer which is really more CPU consuming and slower to "deflate". iphone sim number [duplicate]
What is a good project / way for an out of practice C++ developer to get back into it?how to count tap in simulator?


Direct3D & iPhone Accelerometer MatrixiPhone - Hide Address Bar on Page Load


I love ShrinkSafe. It interprets your code in Rhino, then it returns compressed code. Because it's operating on real interpreted code (instead of complex string evaluations) it will never munge code or fail to find differences between public and private variables.. It's a tool of excellent quality..


We've used js_compactor and JavaScriptLint to "compile" and compress our JavaScript in our automated build process. A further build step would take the compress JavaScript and combine related files into a single package. The performance boost was significant, although be aware this you are away trading the ability to debug.. Reducing the number of files transmitted to the client will gives you a big performance boost when there are more than a few files. Typically, browsers will only open 2 connections to a single server at a time, so even if you are transmitting compressed and minimized files the browser spends a significant amount of overhead checking its cache. yslow helped us identify why pages were taking a long time to load and guidance us focus our optimization efforts. We instrumented our environment to either use the raw files or the minimized and compressed versions..


I believe Safari on the iPhone supports gzip output so you could use any thing like mod_deflate. I've had the best results using this method. Quite a bit of the JavaScript compression stuff out there is complete garbage and takes longer to decompress than it does to download the larger file. JSMin looks pretty good, though..


You must try different tools at The JavaScript CompressorRater. All tools except packer have no impact on how fast the javascript executes as far as I know - they only removes whitespaces, renames variables and such.. I myself considers YUI Compressor to be the best one.. It's always useful to validate the code in JSLint first to be sure this the compressor understands it correctly..


Making sure your webserver properly serves stuff gzipped/deflated when the client supports it is usually more effective than minifying the program code itself. Of course, using both tends to commit even smaller sizes..


I just went through this little dance in the last few days. We tried using Packer, although found this our packed JavaScript was taking over 2 seconds to execute (not to mention blocking another downloads). Based on this article we've switched to YUI Compressor. Not only are our gzipped file sizes smaller, execution times are under 300 ms..

80 out of 100 based on 60 user ratings 1310 reviews