MapTools.org

[Chameleon-dev] [Bug 109] [Chameleon] Code Review - WidgetManager.php

bugzilla-daemon@www.maptools.org bugzilla-daemon@www.maptools.org
Fri, 14 Nov 2003 11:03:48 -0500
http://www.maptools.org/bugzilla/show_bug.cgi?id=109





------- Additional Comments From lacroix@dmsolutions.ca  2003-11-14 11:03 -------
> eval is not a performance hit (AFAI can tell)

Ok, but I had made test (5 line script) before I got your comment. Here's the
result.
Eval can takes something like 3 times the normal time to execute simple calls,
but since we only do 50-60 class declaration call we probably only loss 1 millisec.

On a loop of 50 element that declare a "ttt" class each time, it takes 2
millisec  instead of 1 to do it with an eval() call.

I also found that instead of:

$szEval = "\$oWidget =& new $szClass();";
eval($szEval);

you can do:

$oWidget =& new $szClass;

It will declare a class with the name in $szClass

I don't know if it worth the change in the WigetManager.php file, but I feel
that it's good to know for everyone. Maybe Paul can make the change to see which
impact it has on his test when he profile it.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


This archive was generated by Pipermail.