[sr-dev] domain attributes

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Jul 2 17:46:14 CEST 2009


On Jul 02, 2009 at 18:20, Juha Heinanen <jh at 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



More information about the sr-dev mailing list