Hi,

I suggest not to use create_function.
Because it waste the memory for each calling even if create the same
function.
For example, create_function in AgaviToolkit::expandDirectives use
4864bytes per call.
And it is executed 617 times while the sample's DefaultAction is
runing.(debug mode)
This means about 2.9M bytes are used only for create_function.
It's really waste, don't you think?

test code:
------------
<?
function cf()
{
    // this code is from AgaviToolkit::expandDirectives
    create_function('$match',
                    '$constant = $match[1];' .
                    'return (AgaviConfig::has($constant) ?
AgaviConfig::get($constant) : "%".$constant."%");'
                    );
}

for($i=0; $i < 20000; $i++) cf();
?>
----------


regards,

MugeSo



_______________________________________________
Agavi Dev Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/dev

Reply via email to