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: Sat, 18 Oct 2014 01:11:02 -0400


Hi

On Sat, Oct 11, 2014 at 12:16 PM, Michael Brand <address@hidden> wrote:
Hi Nathaniel

On Fri, Oct 10, 2014 at 9:43 PM, Nathaniel Flath <address@hidden> wrote:
> Mine is a pretty simple table (takes less than a second even in the original
> case):

Earlier I assumed that the issue is a very high number of messages
from the loops. Now your example table clarifies to me that the issue
is that already just one single message can take a significant time of
a message-less table recalculation (your 17 ms).

Only with this I understand now why you want to remove also the
beginning/end processing messages. Good point as it should be
noticeable at least for org-table-iterate-buffer-tables in a buffer
with many tables where each one takes a short time to recalculate.

I really wonder what the reason is that this

    (progn
      (message "%d" (random))  ;; Prevent collapsing of message lines.
      (time (message nil)))

in a terminal (emacs -nw) shows most of the times only 0.05 to 0.10 ms
but in a window it shows most of the times 8 to 22 ms (here: GNU Emacs
24.3.1 on Mac OS X 10.9). Which Emacs version and OS are you using?

I'm running 24.3.1 on Mac OS X  10.8.4.

For your patch I suggest to remove only the first message and to add
the time check to all other messages. This should not make the patch
noticeably slower but would keep showing the progress for table
recalculations that last more than one second. To clean up the last
loop message from the mode line I suggest to check the end messages
against the very first log time in contrast to the next log time used
for the loop messages (variables "log_first" and "log_next" instead of
just "log").

I suggest you split your patch: One for "(when eqlist" and one for the
messages. The change with the messages will then become human readable
also with a simple line diff. 

OK, sounds reasonable.  Patches are attached.
 

> Original recalculation:  (0 0 396224 0)

> Version w/ time checks for per-field messages (still always printing at
> beginning/end of processing):(0 0 56929 0)

> Version w/ time checks and removing all beginning/end of processing
> messages: (0 0 22077 0)

> My patch:  (0 0 17405 0)

I could not reproduce a reliable difference between the last two. As
expected both did not log any message. Can you?

Rrunning more iterations they seemed to be mostly equal.

Patches are attached.

Michael

Attachment: org-table-speedup-1.patch
Description: Binary data

Attachment: org-table-speedup-2.patch
Description: Binary data


reply via email to

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