emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATH] Speedups to org-table-recalculate


From: Nathaniel Flath
Subject: Re: [O] [PATH] Speedups to org-table-recalculate
Date: Thu, 9 Oct 2014 22:56:39 -0700

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 <address@hidden> wrote:
Hi Nathaniel

On Thu, Aug 7, 2014 at 4:57 PM, Nathaniel Flath <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]