Re: [qooxdoo-devel] Speed up Qooxdoo: Why one big build file?
Brought to you by:
ecker,
martinwittemann
From: Sebastian W. <in...@se...> - 2008-02-28 14:03:22
|
Hi Leander, one thing to differenciate is the loading time (network transport) and the other the initialization time (creating classes, properties, objects). After this there is the runtime (e.g. reactions on mouse clicks). Two split the resulting compiled file into multiple files does not reduce the complete size and this way not the initialisation time. What exactly needs to be done is, to split the file according to the usage in the application. I will try to explain in one example: Your application may have a preferences window which uses widgets which are nowhere used, but there. In a normal qooxdoo build all classes, even the ones from your preferences window a bundled into one big file. Following this example the basic idea must be to split an application into the logical parts (main window, preferences, accuout-manager, etc.) not in the source groups (e.g. qx and application code). It is possible to solve this in 0.7.x by using custom generator calls but it is some work to find the ideal groupings. (Documentation: http://qooxdoo.org/documentation/0.7/custom_builds) In 0.8 we will introduce a new build system (if all went well). As if our list for 0.8 isn't already long enough, we add another major improvement: Semi automatic packaging. Each dialog and part of a application simply gets registered in the build configuration file and the system automatically manages the loading of these parts. Commonly used classes are automatically grouped together as well. The new system also use a new caching system and other major improvements. Rebuilds of already build software (just a few classes modified) are done in seconds, not minutes. Both of your suggestions are doable with the new system easily. However in my opinion there are better ways. Preliminary documentation is available here: http://qooxdoo.org/documentation/general/generator2 (trunk only at the moment). Regards, Sebastian Am 27.02.2008 um 15:21 schrieb Leander Hanwald: > Hi all, > > I'm currently think about who to speed up qooxdoo load time. One of > the > main problems for most (I think ;) ) is the big JS file itself, not > the > runtime. > Beside the option that you could use gzip I see other ways to speed up > the loading. > > The most "annoying" part of a build process for me is that qooxdoo > builds everything again and joins it again. But why exactly produce > qooxdoo ONE big file, instead of 2? > I mean, why is qooxdoo and the project linked together? From my > point of > view it's not very usefull. When a Project is changed (and most > project > will do this more often then they change qooxdoo), the qooxdoo part is > reloaden by the client as well. > I understand that loading 100 files is slower then 1 file, but loading > two files instead of one file shouldn't be a great difference. Also > other projects like ExtJS load up to 5 files for itself, and they > still > loading faster then qooxdoo (the the online demos). > > My idea would be the following: > > Source > qooxdoo.js : This file contains all classes of qooxdoo and is > generated only one time, or when user requested > [project].js : This file includes the qooxdoo.js and the single > classes > of the user > -> I think that would speed up the load time of the source version, > now > he loads hunderts of files which is often slowered (when I tested it) > then loading all classes. > > Build: > qooxdoo_[version].js : Like above, but if the uses selected it only > with > the needed classes. Regenerated only if needed > [project]_[version].js : Combined and optimized Project files > loader.js : This file is included the files above. The version > number is > to show the browser definitly when a js file is changed. > -> If php/perl... is involed then the loader.js would load the script > adove through the php/perl... scripts . > -> The loader.js could be skipped if the index.html is autogenerated. > > There is one big advantage of the build version splittet these files: > The Browser can now check if the files are changed separatly, and load > only the changed one. If qooxdoo is not changed -> don't reload it. > For > most projects this would be a speed up on change by at least 50%, in > smaler projects much more. > > Version number: The idea behind them is that you could set the client > side cache to nearly unlimited, so the browser doesn't looks often > (never? <- is that right?) if a file is changed and uses the cached > one, > until he sees the request for a file he doesn't now by name. > > Also it would be nice if qooxdoo could generate the gzip Version in > the > build process as well, and also produce php/perl/ruby/python loading > scripts to choose the right JS Version and set the browser caching as > well. I could write some PHP Scripts that helps here. > > I know that this is nothing for qooxdoo 7.x, but for 8.x it seems > "sexy" > for me. > > What did the rest thinks about that? > > Greetings, > Leander > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > qooxdoo-devel mailing list > qoo...@li... > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |