From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: [PATH] Speedups to org-table-recalculate Date: Fri, 10 Oct 2014 12:35:21 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcXXf-0002Ls-7f for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 06:35:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcXXe-00075y-7h for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 06:35:23 -0400 Received: from mail-qa0-x22e.google.com ([2607:f8b0:400d:c00::22e]:48852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcXXe-00075m-33 for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 06:35:22 -0400 Received: by mail-qa0-f46.google.com with SMTP id w8so1417609qac.33 for ; Fri, 10 Oct 2014 03:35:21 -0700 (PDT) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nathaniel Flath Cc: org-mode List Hi Nathaniel On Fri, Oct 10, 2014 at 7:56 AM, Nathaniel Flath wrote: > That's still much more slow than not doing it - slightly modifying your > example,: > > (progn > (setq start (current-time)) > (let ((row 0) (log (time-add (current-time) '(0 1 0 0)))) > (while (< row 6543210) > (setq row (1+ row)) > (when (time-less-p log (current-time)) > (setq log (time-add (current-time) '(0 1 0 0))) > (message "row %d" row)))) > (setq end (current-time)) > (print (time-subtract end start))) > > prints (0 43 386499 0) on my computer. > > Removing the when clause: > > (progn > (setq start (current-time)) > (let ((row 0) (log (time-add (current-time) '(0 1 0 0)))) > (while (< row 6543210) > (setq row (1+ row)))) > (setq end (current-time)) > (print (time-subtract end start))) > > Results in: > (0 1 277641 0) > > So adding the logging here slows it down by about 43x - It doesn't seem > worth it. Your measurement shows that "(when (time-less-p log (current-time)) [...]" takes 6.4 microseconds or can run 150'000 times per second. I would expect it to be negligible compared to what Org has to do for each row or field like parse, calculate, format etc. Otherwise it would mean that Org can perform more or not significantly less than 150'000 rows or fields per second on an appropriate example table. Tersely formulated I expect this performance comparison: nothing or empty loop << a conditional message with time check << Org performs a simple formula on one row or field << an unconditional message Can you make a performance comparison on your table between (a) your patch and (b) without your patch but with "(when (time-less-p log (current-time)) [...]" plus describe or share this table? Michael