GNU bug report logs - #47419
Misleading profiler info

Previous Next

Package: emacs;

Reported by: scame <laszlomail <at> protonmail.com>

Date: Fri, 26 Mar 2021 19:58:01 UTC

Severity: normal

Found in version 27.1

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: scame <laszlomail <at> protonmail.com>
To: "scame via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: 27.1; slow running of snippet which reorders the file
Date: Fri, 26 Mar 2021 19:56:53 +0000
[Message part 1 (text/plain, inline)]
As discussed on emacs-helpĀ  I'm posting this example here which
reorders the file and runs slowly.

Though it's an sql dump file with long lines, the file is navigable without
any problem or slowness. Only this snippet runs slowly.

Here's the snippet:

(progn
  (goto-char (point-min))
  (when (search-forward "INSERT INTO `test2` (`aa`, `bb`) VALUES" nil t)
    (beginning-of-line)
    (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)))
        ))))


And the example file to run it on  is attached. (anonymized sql dump)

[dump.zip (application/x-zip-compressed, attachment)]

This bug report was last modified 4 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.