all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Raffael Stocker <r.stocker@mnet-mail.de>
Cc: 67536@debbugs.gnu.org
Subject: bug#67536: 29.1; Calc mode's math-read-preprocess-string conses unnecessarily
Date: Thu, 30 Nov 2023 09:00:18 +0200	[thread overview]
Message-ID: <83h6l367zx.fsf@gnu.org> (raw)
In-Reply-To: <yplm5y1k8cye.fsf@mnet-mail.de> (message from Raffael Stocker on Wed, 29 Nov 2023 22:29:38 +0100)

> From: Raffael Stocker <r.stocker@mnet-mail.de>
> Date: Wed, 29 Nov 2023 22:29:38 +0100
> 
> 
> Org table re-calculation is very slow, partly due to
> math-read-preprocess-string of calc mode consing unnecessarily.  For
> example, in one (large) table, I get the following memory usage from the
> profiler:
> 
> ...
>      60,252,646  96%   - org-ctrl-c-ctrl-c
>      60,248,166  96%    - org-table-calc-current-TBLFM
>      60,216,431  96%     - funcall-interactively
>      60,205,119  96%      - org-table-recalculate
>      49,094,651  78%       - org-table-eval-formula
>      32,624,631  52%        - calc-eval
>      32,624,631  52%         - calc-do-calc-eval
>      32,620,487  52%          - calc-do-calc-eval
>      32,611,151  52%           - math-read-exprs
>      29,388,838  47%            + math-read-preprocess-string
>       2,343,257   3%            + math-read-expr-list

This is not memory usage, this is CPU usage measured by using
memory-allocation functions as triggers to probe for the function that
is being executed.  So its evidence about consing and GC pressure is
indirect at best.

Can you instead look at the values of gcs-done and gc-elapsed before
and after running the offending code, and show the delta of each one
of them, with and without your proposed changes?  Then we will see a
much more direct evidence about the number of GC cycles and the time
spent in GC, and could make the decision about how to improve the
situation.

Thanks.





  reply	other threads:[~2023-11-30  7:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 21:29 bug#67536: 29.1; Calc mode's math-read-preprocess-string conses unnecessarily Raffael Stocker
2023-11-30  7:00 ` Eli Zaretskii [this message]
2023-11-30 18:28   ` Raffael Stocker
2023-11-30 19:14     ` Eli Zaretskii
2023-12-01 17:34       ` Raffael Stocker
2023-12-01 18:12         ` Eli Zaretskii
2023-12-01 21:10           ` Raffael Stocker
2023-12-02  8:03             ` Eli Zaretskii
2023-12-02 14:56               ` Mattias Engdegård
2023-12-02 19:26                 ` Raffael Stocker
2023-12-03 10:43                   ` Mattias Engdegård
2023-12-03 11:13                     ` Raffael Stocker
2023-12-03 11:58                       ` Mattias Engdegård
2023-12-05 18:14                     ` Raffael Stocker
2023-12-16  9:40                       ` Eli Zaretskii
2023-12-18 10:55                         ` Mattias Engdegård
2023-12-18 11:39                           ` Raffael Stocker
2023-12-19 16:16                             ` Mattias Engdegård
2023-12-19 17:09                               ` Raffael Stocker
2023-12-19 18:15                                 ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h6l367zx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67536@debbugs.gnu.org \
    --cc=r.stocker@mnet-mail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.