From patchwork Fri Feb 25 16:46:14 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Salt X-Patchwork-Id: 11790 Received: from anchor-post-33.mail.demon.net ([194.217.242.91]) by www.linuxtv.org with esmtp (Exim 4.34) id 1D4jnR-00087p-A8 for vdr@linuxtv.org; Fri, 25 Feb 2005 19:02:37 +0100 Received: from youmustbejoking.demon.co.uk ([212.228.127.8] helo=pentagram.youmustbejoking.demon.co.uk) by anchor-post-33.mail.demon.net with esmtp (Exim 4.42) id 1D4jnS-000PFn-Ag for vdr@linuxtv.org; Fri, 25 Feb 2005 18:02:39 +0000 Received: from [192.168.0.2] (helo=riscpc) by pentagram.youmustbejoking.demon.co.uk with esmtp (Exim 4.34) id 1D4jn2-0006qx-T7 for vdr@linuxtv.org; Fri, 25 Feb 2005 18:02:13 +0000 Date: Fri, 25 Feb 2005 16:46:14 +0000 From: Darren Salt To: vdr@linuxtv.org Subject: Re: [vdr] Problems with 20 Timers Message-ID: <4D42D71DFA%linux@youmustbejoking.demon.co.uk> References: In-Reply-To: User-Agent: Messenger-Pro/3.11b2 (MsgServe/3.00) (RISC-OS/4.02) POPstar/2.06-ds.3 X-Editor: Zap 1.46 (23 Oct 2004) [TEST], ZapEmail 0.28.3 (03 Feb 2005) (32) X-SDate: Fri, 4196 Sep 1993 16:45:59 +0000 X-Message-Flag: Outlook Express is broken. Upgrade to mail(1). MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.0.2 X-SA-Exim-Mail-From: linux@youmustbejoking.demon.co.uk X-SA-Exim-Scanned: No (on pentagram.youmustbejoking.demon.co.uk); SAEximRunCond expanded to false X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2005 18:02:37 -0000 Status: O X-Status: X-Keywords: X-UID: 333 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. 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) {