Overhead

0 views
Skip to first unread message

John O.

unread,
Apr 1, 2010, 4:44:00 PM4/1/10
to php-outline
Hi! I've been using Outline for a while now. I think it's great!

Today I dumped the contents of the template object.
I found that many variables are contained in the object multiple
times.

For example:

'templatename':

$tpl->templatename
$tpl->vars->templatename
$tpl->engine->config->outline_context->templatename
$tpl->engine->config->outline_context->vars->templatename
$tpl->config->outline_context->templatename
$tpl->config->outline_context->vars->templatename

'bracket_open':

$tpl->engine:protected->config->bracket_open
$tpl->engine:protected->config->outline_context->vars:protected-
>engine:protected->config->bracket_open
$tpl->engine:protected->config->outline_context->vars:protected-
>config:protected->bracket_open
$tpl->config:protected->bracket_open
and two more times!

Every variable that I assign to the template is contained three times
in the $tpl object!

Why are the variables saved separately for config, engine and at the
root level of the object?
Why carry around this excess overhead?

mindplay.dk

unread,
Apr 1, 2010, 4:57:43 PM4/1/10
to php-outline
I'm pretty sure those are stored as references - so you're not
carrying any additional overhead, they are just multiple references to
the configuration to enable it to be accessed locally from whatever
classes need access to it.

John O.

unread,
Apr 13, 2010, 10:38:59 AM4/13/10
to php-outline
Ah, okay. Good to know. Thank you for your quick reply.
Reply all
Reply to author
Forward
0 new messages