[Asterisk-Dev] sched.c::schedule function can be a bottleneck and is optimised backwards

Andreas Sikkema h323 at ramdyne.nl
Sat Oct 29 15:49:16 MST 2005


On Fri, 2005-10-28 at 21:08 +0200, steve at daviesfam.org wrote:
> With lots of registrations, its true that many many tasklets are getting 
> scheduled, but I didn't expect this activity to be my bottleneck.
> 
> By inspection, I'm pretty sure that the time is going in schedule().
> 
> The logic searches down the schedule queue, looking for the first entry to 
> run later than the new one.  The new one is then inserted there.
> 
> It would be much quicker to search the list backwards.  Stands to reason 
> that the new entry is much more likely to go at the end or near to the end 
> of the queue than it is to go near the start.

I think the problems you're having might look like some of the
discussions going on on the linux kernel mailinglist about the kernel
timers. There's an article on lwn.net (http://lwn.net/Articles/156325/)
which mght point you in the right direction.

Good luck on getting some inspiration!


-- 
Andreas Sikkema




More information about the asterisk-dev mailing list