unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: vincent.belaiche@gmail.com (Vincent Belaïche)
To: Eli Zaretskii <eliz@gnu.org>
Cc: 22519@debbugs.gnu.org, "Vincent Belaïche" <vincent.belaiche@gmail.com>
Subject: bug#22519: 25.1.50; Emacs gets stuck while doing incremental search forward
Date: Tue, 15 Mar 2016 14:28:18 +0100	[thread overview]
Message-ID: <84a8lzzx8t.fsf@gmail.com> (raw)
In-Reply-To: <83egbefizx.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2372 bytes --]

Dear Eli,

Ok, I decided to make some test bench (herein attached).

I get the following interaction:

 $ ./emacs-bug22519.sh --fundamental no
-| mode: normal
-| latin-9=(0.588 5 0.031999999999999994)
-| utf-8=(111.257 146 1.3299999999999979)
 $ ./emacs-bug22519.sh --fundamental yes
-| mode: fundamental
-| latin-9=(0.209 0 0.0)
-| utf-8=(95.442 129 1.121)


As you see, in normal mode utf-8 is 189 times slower than latin-9, and
in fundamental mode, it is 456 times slower.

So, IMHO it is a bug: user expererience is *GREATLY* damaged when you
have the funny math symbols displayed.

Please feel free to ask me to modify the attached script according to
your wishes, eg to new command line option, like making configurable
number of word insertion for shorter tests.

VBR,
	Vincent.

Le 13/03/2016 17:19, Eli Zaretskii a écrit :
>> From: vincent.belaiche@gmail.com (Vincent Belaïche)
>> Cc: Vincent Belaïche <vincent.belaiche@gmail.com> ,
>>  22519@debbugs.gnu.org
>> Date: Sun, 13 Mar 2016 09:10:11 +0100
>>
>> Oooops... It is back again. It seems that this has to do with how long
>> the Emacs session has been open. I was comparing the 2016-01-29 Emacs
>> the session of which had been open for a couple of days with the
>> recently build 2016-03-11 Emacs the session of which was just open. And
>> the latter seemed not to have the problem any longer.
>
> I have now tried this file in a session that has been running for 10
> days, and I see no problems with this file.
>
>> Not correct, the editing is lengthy *ALSO* with the latter Emacs.
>>
>> Please note that only the latex2e-fr.texi buffer is slow, the other
>> buffers behave OK.
>
> I'm afraid this is something specific to your configuration, so you
> will have to find which parts of your configuration cause this issue.
> Also, you originally talked about Emacs getting stuck, while now you
> seem to say about slow editing -- is this really the same problem, and
> if so, does it get stuck or just works slowly?
>
> In any case, without additional information I don't see how we could
> move further in debugging this problem.  I'd begin with looking into
> the minor modes you have enabled in that buffer, disabling them one by
> one, until the problem goes way.  If that doesn't help, look at
> features that hook into post-command-hook.


[-- Attachment #2: Benchmark --]
[-- Type: text/plain, Size: 3325 bytes --]

#!/bin/bash

# Instruction for use:
# ~~~~~~~~~~~~~~~~~~~~
# 1) Copy this script into some temporary directory, and
# 2) Download
#    svn.gna.org/viewcvs/*checkout*/latexrefman/trunk/latex2e-fr.texi
#    to some place
# 3) Adapt the two variables TEXI_FILE & EMACS to your configuration, under
#    some unsername entry distincitive of you.
# 4) Run the script.



case $USERNAME in
    Vincent)
	TEXI_FILE=/local/projects/latexrefman/latexrefman/latex2e-fr.texi
	EMACS=/c/Nos_Programmes/GNU/Emacs/bin/emacs.exe;;
    
    *)
	echo "Uknown user!!" >2
	exit;;
esac

if [ "$1" == "--fundamental" ]; then
    FUNDAMENTAL=$2
fi    
case $FUNDAMENTAL in
    yes|true|1) FUNDAMENTAL=1;;
    no|false|0) FUNDAMENTAL=0;;
    *) FUNDAMENTAL=1;;
esac

HERE=$(dirname $0)

# We make some AWK script to remove of the file local variable that
# are not relevant for the test, and configure the coding either to
# latin-9 or to utf-8. We will show that utf-8 (ie math symbol are
# displayed) is horribly slower than latin-9
cat >emacs-bug22519.awk <<EOF
BEGIN                        { enb = 0}
/^@c Local Variables:/       { enb = 1; print}
/^@c End:/                   { enb = 0 }
enb == 1 && \$2 == "coding:" { \$3=coding "-unix";
                               print;
                               if(fundamental) 
                                 print "@c mode: fundamental"
                             }
enb == 0                     { print }
EOF

for CODING in utf-8 latin-9; do
    awk -v coding=$CODING \
	-v fundamental=$FUNDAMENTAL \
	-f emacs-bug22519.awk \
	$TEXI_FILE > $HERE/${CODING}-l2e-fr.texi
done

# Now we make some Emacs script to make the benchmarking. Benchmark
# result is saved to some result.txt file
cat >$HERE/emacs-bug22519.el <<EOF
(defconst max-word-size 10)
(defconst rand-word-string-size 1000)
(defconst rand-word-string (apply 'string
   (let (l)
      (random "Some first seed")
      (dotimes (i (+ max-word-size rand-word-string-size))
         (push (+ 32 (random 80)) l))
      l)))
(let (result)
  (dolist
    (f '("latin-9" "utf-8"))
    (find-file (concat "$HERE/" f "-l2e-fr.texi"))
    (re-search-forward "@node Math symbols")
    (beginning-of-line 10)
    (let ((beg (point))
          (end (save-excursion
                   (re-search-forward "^@node")
                   (beginning-of-line)
                   (point)))
          pos ws spos)
        (push f result)
	(random "Some second seed")
        (push
           (benchmark-run
             (dotimes (i 200)
               (setq pos  (random (- end beg))
                     ws   (1+ (random max-word-size))
	             spos (random rand-word-string-size))
               (goto-char (+ beg pos))
               (insert (substring rand-word-string spos (+ spos ws)))
               (recenter) ; force refreshing the screen !!              
               (setq end (+ end ws))))
           result)
	(set-buffer-modified-p nil)
        (kill-buffer)))
      (setq result (nreverse result))
     (find-file "$HERE/result.txt")
     (erase-buffer)
     (while result
       (insert (pop result) "=" (format "%S" (pop result)) "\n")))
(save-buffers-kill-terminal t)
EOF

$EMACS -Q --load "$HERE/emacs-bug22519.el"

case $FUNDAMENTAL in
     1) echo "mode: fundamental";;
     0) echo "mode: normal";;
esac
cat $HERE/result.txt



  reply	other threads:[~2016-03-15 13:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <84vb4rhag0.fsf@gmail.com>
2016-03-12 17:46 ` bug#22519: 25.1.50; Emacs gets stuck while doing incremental search forward Eli Zaretskii
2016-03-13  7:11   ` Vincent Belaïche
2016-03-13  8:10     ` Vincent Belaïche
2016-03-13 16:19       ` Eli Zaretskii
2016-03-15 13:28         ` Vincent Belaïche [this message]
2016-03-15 15:53           ` Vincent Belaïche
2016-03-15 18:11           ` Eli Zaretskii
2016-03-16 11:16             ` Vincent Belaïche
2016-03-16 16:08               ` Eli Zaretskii
2016-03-16 17:40                 ` Vincent Belaïche
2016-03-16 20:24                   ` Eli Zaretskii
2016-03-17  9:14                     ` Vincent Belaïche
2016-03-17 16:20                       ` Eli Zaretskii
2016-05-24 10:16                         ` Vincent Belaïche
2016-05-24 15:31                           ` Eli Zaretskii
2016-12-07 19:41                             ` Glenn Morris
2016-02-01  9:04 Vincent Belaïche
2016-02-01 19:06 ` Eli Zaretskii
2016-02-02  7:18 ` Vincent Belaïche
2016-02-02 16:16   ` Eli Zaretskii
2016-03-10 12:18     ` Vincent Belaïche

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=84a8lzzx8t.fsf@gmail.com \
    --to=vincent.belaiche@gmail.com \
    --cc=22519@debbugs.gnu.org \
    --cc=eliz@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.
Code repositories for project(s) associated with this public inbox

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

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).