From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: `org-clock--oldest-date` performance Date: Sat, 20 Jan 2018 12:14:52 +0100 Message-ID: <87po64ok7n.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecr6x-0006tk-8x for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 06:15:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecr6w-0000sO-4o for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 06:14:59 -0500 Received: from relay2-d.mail.gandi.net ([2001:4b98:c:538::194]:60590) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecr6v-0000rZ-VE for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 06:14:58 -0500 In-Reply-To: (Jack Henahan's message of "Sat, 20 Jan 2018 01:52:59 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Jack Henahan Cc: emacs-orgmode@gnu.org Hello, Jack Henahan writes: > I've run into a performance issue in `org-clock` which I've narrowed > down to being caused by the calculation in the defconst for > `org-clock--oldest-date`. In particular, invoking `org-clock-in` or > eagerly loading `org-clock` on init incurs a 21(!) second delay while > calculating the constant. If I inline the value (`(-1034058236842 > -45726)`, in my case), the delay vanishes. > > So, context out of the way (just in case someone else already knows an > easier fix), I'd like to spend some spare cycles finding a better way to > go about the functionality this is meant to provide. If I've read the > source correctly, it's meant to provide a view of all the clocks by > showing all clocks between some time way in the past until now. A correct fix would be to remove `org-clock--oldest-date', which is used only in one place, and replace it with nil. Then all `org-clock-special-range' callers need to be updated to handle this nil start value. Regards, -- Nicolas Goaziou