Hello Hugh, >> Finally we need another approach to do obfuscation >> right. Maybe we can take a look at this again after the class >> definition changes of qooxdoo 0.7. >> > > I noticed that obfuscation has been removed in SVN. > > I have been thinking about another approach to this which could have > significant benefits - reduced script size, and improvements in speed of > execution. Should also be straightforward to implement safely. > > For every place where a new namespace is defined, also define an alias for > that namespace. Then when that namespace is referenced in code, use the > alias. Any references in code that use computed values would still work as we > are simply defining an alias for the original, which would still exist. > > The alias could be simply a global variable e.g. qa, qb, qc or to avoid > polluting globals, use q.a, q.b, q.c. > > Using lower and upper case means that 2704 classes could be accomodated in 2 > characters. > > You could, of course, define them as additional entries in the $ array. > > This would reduce the size of code (but probably not dramatically). However, > it would also improve execution time. We all know how important it is to > cache deep namespace references in loops, and this would do it automatically > throughout the application, for every place. >
This strategy could really work. This would be fun to implement, unfortunately our own time is limited so we will not target ths in the near future. If you or someone else is willing to implement such kind of optimization/obfuscation I could help getting started. The generator stuff really isn't too complicated. Basically all JavaScript classes get transformed in a DOM like tree representation on which modifications can be applied. Just take a look at variantoptimizer.py, stringoptimizer.py or variableoptimizer.py. Best Fabian ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
