[sr-dev] avoiding hash calculation in xavp api function calls
Daniel-Constantin Mierla
miconda at gmail.com
Fri Dec 14 09:17:50 CET 2012
Hello,
there are collisions on hash id, you can't rely on it as unique id.
I wanted to comment, but comment but didn't get to it yesterday, caught
by other tasks.
Have you measured the impact? The same is done for avp with string names
and there were no complains. All the operations are in memory and for
such names which are quite short, there are not so many extra operations.
The option would be to store the id along with the string in pv name
structure, but then it increases the memory, not only for xavps, but for
all pv specs. SER guys dropped usage of avps with integer id because the
overhead for using just string names was insignificant, compared with
the complexity of dealing with both.
Probably optimizations can be done in lot of places, but at expense of
something else, like more memory or more complexity (translated in
harder code management).
Cheers,
Daniel
On 12/14/12 6:41 AM, Juha Heinanen wrote:
> i didn't get any comments about needless script time calculation of xavp
> name hash values.
>
> one hack to avoid the hash calculation could be such that if str *name
> passed to xavp api functions has len=0 then s contains pre-calculated
> hash value.
>
> -- juha
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
More information about the sr-dev
mailing list