We have a few questions regarding generated code of a class file:
1. We notice that there is declaration of local variables in the beginning
before the class definition. These declarations are the replaced strings in the
code of the class. It is understandable that a string which has been used more
than one time is put in a local variable to save space by using the local
variable to refer to. But why do you replace strings used only one time with a
local variable and the string in the table?
As far as we can see, in the one-time use, unnecessary declaration lines are
executed and slows down the execution.
We have done some testing and can see that execution of:
var xx = "test string";
widget.setToolTipText(this.tr(xx));
takes longer time than
widget.setToolTipText(this.tr("test string"));
if the string is used only once.
...or is there any other reason why you do this?
We ask because we need to get the size of the application down and we need to
increase execution speed.
2. We have also noticed that you put the names of the local variables holding
the strings mentioned above to the same, i.e. they are not for the application
globally named. Is there a specific reason for that, more than you might want
to keep modularisation, which we believe is not relevant here as the code can
not be pruned and grafted with other pieces of code after generating it.
3. We have previously added an enhancement bug text about the translation
strings and converting the .po files in the .js files. Now the key of the
translation string is multiplied in all language .js files and in the execution
code file too. This could be collapsed if global keys were used instead of the
long original key strings. The global key should be "dynamic" in size 1, 2 or
3-byte long.
Do you have any plan for fixing questions 1, 2 and 3 above and in that case
when?
Our preliminary calculations and testing point in the direction of substantial
space saving and less, but though, a smaller increase of execution speed. Do
you agree with that?
The testing procedure was done by:
1. removing local variables for one-time used strings -> put them in code
instead of referring variables.
2. replacing all translation strings referring to .po keys with dynamic keys
i.e. dynamic 1,2 or 3-byte keys (aa, ab, abc etc) depending on how many strings
existed globally in the application. Gives maximum space saving.
As we did the testing we wrote a small python reduction app to do what we
wished for the testing application.
Stefan
------------------------------------------------------------------------------
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