Hi Stefan,
Is your byte size comparison after the scripts were optimized with gzip? GZip
should optimize such duplicated strings very well, so we should only worry
about the execution performance. Like Thomas already has mentioned, the string
optimization is crucial for old browsers - so you can just disable it, when you
build the version for new browsers.
Have you already tried to use google closure compiler
(http://code.google.com/intl/de-DE/closure/compiler/docs/gettingstarted_app.html)?
You can use it on the already optimized qooxdoo javascript files. It will help
you to save some bytes! (use SIMPLE_OPTIMIZATIONS for optimization).
Tino
Am 06.03.2011 um 16:24 schrieb Stefan Andersson:
>> is declared in the beginning of the class. The question is if it is
>> possible to sectionize it even further i.e. more related to the specific
>> function where is it used? Now it is related to the whole class i.e. local
>> to the whole class.
>Due to the dynamic nature of JavaScript it is very hard to predict which
>functions will be used at run time and which not.
Of course and we know that very well.
I didn't really mean that. Let me explain again. By using scope
(function() {
qooxdoo local string declarations for all functions below etc.
qooxdoo class declaration {
function 1
function 2
function n
}
})();
the local string declarations are connected to the whole class. It means even
the strings for not executed functions will be executed.
If we forget to predict what functions will be executed, which is as you said
impossible, and instead look at if there is any other way to
make the string declarations scoped to the functions. Is there any reasonable
way of doing that?
Putting another anonymous scope function around can not be reasonable, like
this I guess:
(function() {
qooxdoo class declaration {
(function() {
qooxdoo local string declarations for only current function
function 1
})();
(function() {
qooxdoo local string declarations for only current function
function 2
})();
(function() {
qooxdoo local string declarations for only current function
function n
})();
}
})();
but is there any other way to make it local to the function? A pure global
string/lexical table instead of local variable declarations?
Probably not...so the cost of declaring all strings for all functions before
the class definition is probably the least bad solution.
Then this has to be in mind when developing the classes and NOT make them to
big and instead spread the memory and speed cost over several classes.
Stefan
<ATT00001..txt><ATT00002..txt>
Tino Butz
Mobile Architect
1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-4488
[email protected]<mailto:[email protected]>
Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel