Problems with 20 Timers

Message ID 4D42D71DFA%linux@youmustbejoking.demon.co.uk
State New
Headers

Commit Message

Darren Salt Feb. 25, 2005, 4:46 p.m. UTC
  I demand that Chris Warren may or may not have written...

[snip]
> It seems that the more timers you have the slower VDR (1.3.21) becomes. I
> normally get "max. latency time 2 seconds" in my syslog, however when I
> have 20 timers, I get "max. latency time 17 seconds". What's causing it to
> slow down so much?
[snip]

The attached patch (which is in my vdr package) should help.
  

Patch

diff -urNad vdr-1.3.18/timers.c /tmp/dpep.d4jqSK/vdr-1.3.18/timers.c
--- vdr-1.3.18/timers.c	2005-01-09 17:03:30.000000000 +0000
+++ /tmp/dpep.d4jqSK/vdr-1.3.18/timers.c	2005-01-09 17:03:32.000000000 +0000
@@ -545,6 +545,7 @@ 
   if (Schedules) {
      if (!lastSetEvents || Schedules->Modified() >= lastSetEvents) {
         for (cTimer *ti = First(); ti; ti = Next(ti)) {
+	    if (ti->StartTime() - time(NULL) > 60*60*24*2) continue; // #reduce cpu load
             const cSchedule *Schedule = Schedules->GetSchedule(ti->Channel()->GetChannelID());
             if (Schedule) {
                if (!lastSetEvents || Schedule->Modified() >= lastSetEvents) {