[Ns-developers] Don't recompute NodeList::End () at every loop in GlobalRouteManagerImpl
Guillaume Seguin
guillaume.seguin at ens.fr
Mon Aug 24 04:02:19 PDT 2009
On 23 août 2009 à 21:09:08 (-0700), Tom Henderson wrote :
> Mathieu Lacage wrote:
>> On Wed, 2009-08-19 at 16:23 +0200, Guillaume Seguin wrote:
>>
>>>> I don't think the listEnd variable in your patch causes any Node reference
>>>> count to increase, unless I miss something.
>>>>
>>>
>>> Hmm yeah this sounds right. After checking the code again, most likely those
>>> Unrefs were coming from the NodeListPriv object, which is ref'd and unref'd in
>>> NodeList::End () I believe.
>>
>> ha, good catch: that is the root of the problem most likely.
>>
>>>> I still wish NodeList::End could be effectively inlined so that we would be
>>>> speeding up not only global routing but other code using NodeList as well.
>>>>
>>> Yeah, this might be a worthy gain, though the trip through the singleton getter
>>> might be expensive part.
>>
>> I guess you could do something along the lines of:
>> - make End inline
>> - mark singleton get functions inline
>> - make get function return a const & Ptr<T> or a raw pointer
>>
>> (I did not look at the code to check if this makes sense at all)
>>
>
> Guillaume, I would be fine with either solution you choose (your
> original patch, or inlining End if the above were to work out).
>
Well, I think that the two solutions are distinct, one being micro-optimization
and the other one being some more general optimization (the inlining).
Guillaume
More information about the Ns-developers
mailing list