Untitled document

Another step forward to highly optimized applications based on qooxdoo: I would like to introduce the tree "compiler". The tree compiler is able to "compile" a syntax tree (generated by treegenerator.py which uses the tokenizer.py) back to optimized JavaScript code. Its feature set is comparable to the old compiler, which was directly based on the result of the tokenizer.py script. It completely removes comments, whitespaces and other optional stuff from the original JavaScript code.

This tree compiler is an important step, because it will allow us to do the following awesome things in the future:

  • Remove complete methods (debug statements, ...)
  • Remove cross-browser constructions and generate a version for each browser/engine.
  • Compress variable names
  • Lay out strings and reduce usage of simple constants (like "auto", "100%", ...) for considerable IE performance improvements
  • Obfuscate the whole application (variable, function and class names)

etc.

Now the interesting part: The tree compiler is the default from now on. It is already available in SVN and will be in the final release of qooxdoo 0.6. The tree compiler was tested against qooxdoo and another big internal project so we think it's quite stable already. It may not be free of bugs however, but I'm happy to fix bugs as fast as you can report them ;)

If you have problems with this new compiler, you can use the old one using the "--use-token-compiler" argument (generator.py). Each Makefile which is included in qooxdoo, has a new variable (OLDCOMPILER) in the first lines of the file which lets you select the compiler (simply set it to "true").

I hope you enjoy this new era of JavaScript optimization. Kudos to Til - without the treegenerator.py developed by him, qooxdoo would maybe not have seen such a tree-based optimizer.

You can immediately test the new compiler. Its results can also been seen online in the online demos and the API viewer.

For all SDK/source version users: Please make sure to delete the directory ".cache". A simple "make distclean" will do this for you.