From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathaniel Flath Subject: Re: [PATH] Speedups to org-table-recalculate Date: Thu, 9 Oct 2014 22:56:39 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2f9ac6f53d405050b36d0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcTBx-0002M6-SP for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 01:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcTBw-0001Wd-Le for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 01:56:41 -0400 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:33391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcTBw-0001WV-Fa for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 01:56:40 -0400 Received: by mail-oi0-f51.google.com with SMTP id h136so5434919oig.38 for ; Thu, 09 Oct 2014 22:56:39 -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: Michael Brand Cc: org-mode List --001a11c2f9ac6f53d405050b36d0 Content-Type: text/plain; charset=UTF-8 Sorry for the late response - missed this for a while. 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. On Sun, Aug 17, 2014 at 6:39 AM, Michael Brand wrote: > Hi Nathaniel > > On Thu, Aug 7, 2014 at 4:57 PM, Nathaniel Flath > wrote: > > I'd be fine with displaying every > > second, but I don't see a good way of doing this - do you have any > > suggestions? > > I thought of something like in this example: > > (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)))) > > Michael > --001a11c2f9ac6f53d405050b36d0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry for the late response - missed this for a while.
That's still much more slow than not doing it - slightl= y modifying your example,:

(progn
= =C2=A0 (setq start (current-time))
=C2=A0 (let ((row 0) (log (tim= e-add (current-time) '(0 1 0 0))))
=C2=A0 =C2=A0 (while (<= row 6543210)
=C2=A0 =C2=A0 =C2=A0 (setq row (1+ row))
= =C2=A0 =C2=A0 =C2=A0 (when (time-less-p log (current-time))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (setq log (time-add (current-time) '(0 1 0 0))= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "row %d" row))))=
=C2=A0 (setq end (current-time))
=C2=A0 (print (time-s= ubtract end start)))

prints=C2=A0(0 43 38649= 9 0) on my computer.=C2=A0

Removing the when claus= e:

(progn
=C2=A0 (setq start (curre= nt-time))
=C2=A0 (let ((row 0) (log (time-add (current-time) '= ;(0 1 0 0))))
=C2=A0 =C2=A0 (while (< row 6543210)
= =C2=A0 =C2=A0 =C2=A0 (setq row (1+ row))))
=C2=A0 (setq end (curr= ent-time))
=C2=A0 (print (time-subtract end start)))
<= div>
Results in:
(0 1 277641 0)

<= /div>
So adding the logging here slows it down by about 43x - It doesn&= #39;t seem worth it.

On Sun, Aug 17, 2014 at 6:39 AM, Michael Brand <michael.ch.brand@gmail.com> wrote:
Hi Nathaniel

On Thu, Aug 7, 2014 at 4:57 PM, Nathaniel Flath <flat0103@gmail.com> wrote:
> I'd be fine with displaying every
> second, but I don't see a good way of doing this - do you have any=
> suggestions?

I thought of something like in this example:

(let ((row 0) (log (time-add (current-time) '(0 1 0 0))))
=C2=A0 (while (< row 6543210)
=C2=A0 =C2=A0 (setq row (1+ row))
=C2=A0 =C2=A0 (when (time-less-p log (current-time))
=C2=A0 =C2=A0 =C2=A0 (setq log (time-add (current-time) '(0 1 0 0))) =C2=A0 =C2=A0 =C2=A0 (message "row %d" row))))

Michael

--001a11c2f9ac6f53d405050b36d0--