On Jul 02, 2009 at 18:20, Juha Heinanen jh@tutpro.com wrote:
Andrei Pelinescu-Onciul writes:
They are looked twice but only at startup (fixup for the script and the modules) so there shouldn't be any runtime performance hit because of this.
if i write in my script somewhere
$avp("fd") = "foo";
and in some other place reference $fd, how can double lookup during runtime be avoided?
At fixup time $fd is looked-up. If it's a pvar is replaced with a pv spec. If it's not with an avp spec. At runtime whatever is already "fixed-up" is resolved. In the $fd case -> an avp ($avp("fd") is cleary a pvar, and $fd it can be a pvar or an avp: if at fixup pvar lookup($fd) fails => its avp => it's marked as avp an at runtime only avp search is used).
Andrei