Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to pack JavaScript code without getting performance 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?

like image 629
Thomaschaaf Avatar asked Sep 22 '08 13:09

Thomaschaaf


3 Answers

Use the YUI Compressor

like image 181
Oli Avatar answered Oct 26 '22 19:10

Oli


Use JSMin and avoid packer which is really more CPU consuming and slower to "deflate"

like image 29
gizmo Avatar answered Oct 26 '22 17:10

gizmo


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.

like image 38
pcorcoran Avatar answered Oct 26 '22 17:10

pcorcoran