[Ns-developers] A Reason for Slowness of NS3

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Sun Feb 15 05:42:35 PST 2009


On Sun, 2009-02-15 at 10:51 +0000, Gustavo Carneiro wrote:

>         Now, to get back to the real issue, I would try to investigate
>         why
>         GetTypeId is called so often instead of blindly modifying the
>         code. In
>         that case, although I did not profile the code, I would bet
>         that this
>         function is called from Object::GetObject and that function is
>         called
>         from the ipv4 stack not caching the output of GetObject.
>         
>         Object::GetObject is a linear search within the list of
>         aggregated
>         objects. As such, using it from a performance sensitive code
>         path does
>         not make much sense. i.e., I would bet that if you bothered
>         with caching
>         the output of GetObject from within the ipv4 stack, you would
>         get much
>         better micro-benchmark results than what you have now. Of
>         course, that
>         would mean increasing your memory footprint to cache the
>         pointer values
>         so, again, is it going to be worth the change ? Only the ipv4
>         maintainers can say so :)
> 
> I have to agree with this.  If there exists _any place_ where
> GetObject is called in a code path that processes individual packets,
> for every packet, I would consider it a bug that needs to be fixed.

You can start using bugzilla then :)

Some of these calls to GetObject have a decent rationale (mostly, avoid
requesting a specific ordering of calls to helper functions in user
scripts) but most of them are pure overhead.

regards,
Mathieu



More information about the Ns-developers mailing list