unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: How should this profiler report interpreted?
Date: Fri, 26 Mar 2021 14:38:51 -0400	[thread overview]
Message-ID: <jwvpmzl3gq7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: Qj91Zay5OwF_IPthaFxVWga2IqCN8Pn092Z9Q4XXIRSFJeijuts2crV797sqRi4WC0ohzcq6Gn86HKHP4UUjN2KSZITnKEJLO0baNMVPZqc=@protonmail.com

>   ...
>   (while (looking-at "INSERT INTO `test2`.+,\\([0-9]+\\));")
>     (let ((item (match-string 1))
>           (line (buffer-substring (line-beginning-position) (line-end-position))))
>       (message item)
>       (save-excursion
>         (re-search-backward (concat "INSERT INTO `test1`.+"
>                                     "VALUES ([^,]+,'[^']*','[^']*','[^']*','[^']*',[^,]+,[^,]+,"
>                                     item
>                                     ","))
>         (end-of-line)
>         (insert "\n" line))
>       (delete-region (line-beginning-position) (1+ (line-end-position)))
>       )))

If that's indeed the code in which all the time is spent, then the
profile is very misleading (IOW bogus) because the time won't be spent
in `save-excursion` but in `re-search-backward`.

If you can reproduce this bogus profile, please `M-x report-emacs-bug`
(ideally with a corresponding sample file on which to run the code).


        Stefan




  parent reply	other threads:[~2021-03-26 18:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 15:24 How should this profiler report interpreted? scame
2021-03-26 17:58 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-26 18:38 ` Stefan Monnier [this message]
2021-03-26 18:48   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-26 19:41     ` Stefan Monnier
2021-03-26 21:45       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-27 16:22         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-27 16:30           ` Emanuel Berg via Users list for the GNU Emacs text editor
  -- strict thread matches above, loose matches on Subject: below --
2021-03-26 21:57 scame via Users list for the GNU Emacs text editor
2021-03-26 22:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-26 19:48 scame via Users list for the GNU Emacs text editor
2021-03-26 20:26 ` Joost Kremers
2021-03-26 15:28 scame via Users list for the GNU Emacs text editor
2021-03-26 15:49 ` Eli Zaretskii
2021-03-26 17:59 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-26 13:59 scame
2021-03-26 14:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-26 14:35 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvpmzl3gq7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).