[quagga-dev 7608] Re: [PATCH 05/10] ospfd: remove unneeded memset from a very hot function
joakim.tjernlund at transmode.se
Mon Jan 11 19:13:35 GMT 2010
paul at jakma.org wrote on 11/01/2010 19:09:00:
> On Mon, 11 Jan 2010, Joakim Tjernlund wrote:
> > Nice to see you back again :)
> Just briefly - I'll be disappearing again, till about May. :(
> Hopefully after that I'll have more time again.
> > Since you are optimizing memsets now
> Ones in functions that appear at the top of the profiles, yes. So
> we've got a fairly good idea its worth playing with it (vs churn and
> risks of introducing bugs).
> > I suggest you look at ospf_lsa_data_new() No point in memset:ing
> > (via CALLOC) when each user does a memcpy directly afterwards.
> Ok. Though, it's so rarely called it doesn't even appear in the flat
> list of functions. (And I've been running ospfd the whole afternoon,
> with 25k odd external LSAs..). ;)
Do you see memsets via CALLOC in the profile? Try doing a malloc
then an explicit memset and see if that shows.
Same for ospf_lsa_dup()
> > You can pass in the ptr and memcpy inside ospf_lsa_data_new() if
> > that feels better. Same problem is ospf_lsa_dup(), just wasting CPU
> > there.
> > On a related note, if you are prepared to do all this for some
> > extra performance you should really consider my much optimized
> > ospf_nexthop_calculation() I suggested(and impl. as part of my
> > unnumbered work).
> Ok, though there's no evidence it needs much optimisation either.
Have you tested with lots of p2p interfaces? It should show
there I think.
More information about the Quagga-dev