From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: [PATH] Speedups to org-table-recalculate Date: Sat, 11 Oct 2014 18:16:12 +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]:48222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XczL5-0005ls-3w for emacs-orgmode@gnu.org; Sat, 11 Oct 2014 12:16:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XczL4-0005hG-64 for emacs-orgmode@gnu.org; Sat, 11 Oct 2014 12:16:15 -0400 Received: from mail-qc0-x233.google.com ([2607:f8b0:400d:c01::233]:44151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XczL3-0005h5-VH for emacs-orgmode@gnu.org; Sat, 11 Oct 2014 12:16:14 -0400 Received: by mail-qc0-f179.google.com with SMTP id x3so3386903qcv.10 for ; Sat, 11 Oct 2014 09:16:12 -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 9:43 PM, Nathaniel Flath 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? 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. > 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? Michael