FAQ
Why not just use GZIP to reduce scripts download time?Why to obfuscate scripts?
Why to optimize scripts?
Is optimization safe? Can it break working code?
I've seen tons of stuff like this. What is so special in this optimizer?
How TrickyScripter works?
Why choose JavaScript and JScript? Why not Flash or something different?
- Why not just use GZIP to reduce scripts download time?
-
TrickyScripter is not replacement for GZIP and it can be used in addition to GZIP.
GZIP is a universal compressor; TrickyScripter is a specialized source code optimizer and obfuscator. Use them together to achieve best possible results.
Try this simple exercise:
- Compress some script with GZIP.
- Process the same file with TrickyScripter, and then compress it with GZIP.
What file is smaller? Usually an optimized and compressed file is about 30-60% smaller than a non-optimized compressed file. It is easy to see why: scripts without comments, redundant spaces and tabs, and same names for all local variables can be compressed much better.
However, GZIP traffic compression is used on many servers, but not all. Support on server side is not needed for TrickyScripter, so you can use it in all your projects on any servers or even without servers (to optimize WSH scripts, extensions for applications etc.).
- Why to obfuscate scripts?
-
Today there are many complex rich internet applications on the web. Some of these applications are commercial and not all authors want to share their secrets for free.
Obfuscation is very similar to encryption. The goal is the same: cracking of the cipher must be more expensive than ciphered information itself.
Also obfuscated files are much smaller than non-obfuscated because obfuscation is side effect of optimization.
- Why to optimize scripts?
-
Optimized scripts are much smaller and download much faster. Usually optimization effect is 30-60% of source size. Sure you can't optimize scripts which are already optimized (as you can't compress already compressed file). Note: optimization effect is highly depends on your coding style. It can be more than 80% of source size if you use a lot of comments and use very long variables names, but it can be less than 20% if you don't use comments and code markup at all and your variables names are very short.
- Is optimization safe? Can it break working code?
-
TrickyScripter only uses safe optimization methods. TrickyScripter was tested with hundreds of different scripts: small and large, simple and complex. All tested scripts work perfect after optimization. Sure, it is possible to create script which can't be optimized properly (if it is your goal I can tell you how). If you have a script which can't be optimized properly by TrickyScripter, please send this script and web-page for this script to support@trickyscripter.com.
- I've seen tons of stuff like this. Whats so special about this optimizer?
-
Download the demo and compare the results with other optimizers.
The main differences are as follows:
Safety. TrickyScripter will carefully optimize your scripts without changes in functionality.
Power. The best results can be achieved only with TrickyScripter.
Usability. TrickyScripter is extremely easy to use. Only few clicks – and optimization is done!Some script optimizers are actually compressors, not optimizers. Script compressors use well known algorithms (LZW, LZ77 etc.) to compress scripts and then add decompressor to make scripts self-extracting. This SFX code is written in JavaScript, but JavaScript is too slow for data decompressing. This means user must wait while script decompressing is in progress (several seconds or maybe even more). This compression is much weaker than GZIP's compression. One of the worst aspects of this is that GZIP can't compress pre-compressed files. So if you use GZIP traffic compression it is better not to compress scripts at source - instead you should optimize them!
TrickyScripter is completely different. It can't decrease GZIP's compression efficiency, but it can increase it a few times. The reason is simple: TrickyScripter is an optimizer, not a compressor. Compressors can't delete redundant data from script but optimizer can. Compressed code must be decompressed before execution but optimized code can be executed as it is.
Compression is a two-way function (compressed script can be decompressed), obfuscation is a one-way functions (obfuscated scripts can't be de-obfuscated).
- How TrickyScripter works?
-
The optimization procedure is as follows:
- Parsing. At this step all strings and regular expressions are temporary deleted from script to keep them unchanged. Also whilst parsing takes place, all unneeded markup and comments are deleted.
- Modeling. At this step TrickyScripter build some kind of object model in memory. Modeling step is needed for proper variables names replacement.
- Optimizing/obfuscation.
At this step, code of all functions and global code became optimized. Actually obfuscation is a side effect.
- Compact variable declarations.
Example:var a=3; var b=5; var c;will be reduced tovar a=3,b=5,c; - Compact objects and arrays declarations:
Example 1:new Object()will be reduced to{}
Example 2:new Array()will be reduced to[] - Replace local variable names with shorter ones.
Example:var longVarName=0will be reduced tovar q=0
- Compact variable declarations.
eval(),setTimeout(),setInterval()and conditional compilation instructions in functions may reduce optimization effect for these functions. - Why choose JavaScript and JScript? Why not Flash or something different?
-
There are several reasons.
- Lots of free and commercial obfuscators/optimizers for Flash, Java and .NET are present on the web but I haven't seen a good (powerful and safe) obfuscator for JS. All obfuscators I've seen are too slow or too weak or buggy. Many obfuscators produce code which is very easy to unobfuscate. My goal was to create a real optimizer and obfuscator for JavaScript.
- I love JavaScript.






