unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: nickrob@snap.net.nz, emacs-devel@gnu.org
Subject: Re: Info is slow in Emacs 22.0.50
Date: Sun, 12 Jun 2005 02:18:47 +0300	[thread overview]
Message-ID: <87psusmk0u.fsf@jurta.org> (raw)
In-Reply-To: <u64wl8396.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 11 Jun 2005 15:52:21 +0300")

> Can you profile info.el with elp.el and show here what were the
> hotspots?  That could give a clue about where to look for the reasons
> for the slowdown.

In Emacs started with -Q -D I see no slowdown at all.  But with full
.emacs loaded and Emacs desktop restored I observe a noticeable
slowdown even on 1GHz PC, when visiting Info nodes with large menus.
So I also could look for the reasons for the slowdown.

I profiled info.el with elp.el and got the following results
for visiting the node (info "(elisp)Top") from the Directory node:

In Emacs started with `emacs -Q -D':

Function Name                     Call Count  Elapsed Time  Average Time
================================  ==========  ============  ============
Info-follow-nearest-node          1           0.647439      0.647439
Info-try-follow-nearest-node      1           0.647387      0.647387
Info-goto-node                    1           0.645898      0.645898
Info-find-node                    1           0.645779      0.645779
Info-find-node-2                  1           0.642741      0.642741
Info-select-node                  1           0.61038       0.61038
Info-fontify-node                 1           0.606797      0.606797
re-search-forward                 730         0.1290569999  0.0001767904
add-text-properties               1266        0.1187029999  9.376...e-05
info-insert-file-contents         2           0.0292629999  0.0146314999
Info-read-subfile                 1           0.026425      0.026425
match-string                      1908        0.0107000000  5.607...e-06
put-text-property                 1559        0.0106910000  6.857...e-06
looking-at                        1409        0.0063000000  4.471...e-06
Info-find-file                    1           0.002987      0.002987
info-file-exists-p                49          0.0021950000  4.479...e-05
Info-index-node                   3           0.001246      0.0004153333
Info-get-token                    4           0.000875      0.00021875
Info-display-images-node          1           0.000757      0.000757
Info-hide-cookies-node            1           0.000731      0.000731
Info-find-node-in-buffer          1           0.00027       0.00027
Info-find-node-in-buffer-1        1           0.000249      0.000249
Info-find-in-tag-table            1           0.000229      0.000229
info-insert-file-contents-1       47          0.0002099999  4.468...e-06
Info-find-in-tag-table-1          2           0.000202      0.000101
Info-extract-menu-node-name       1           0.000171      0.000171
Info-set-mode-line                1           0.000141      0.000141
Info-escape-percent               1           9.5e-05       9.5e-05
Info-following-node-name-re       1           1.3e-05       1.3e-05
Info-node-at-bob-matching         1           7e-06         7e-06
info-initialize                   2           6e-06         3e-06

With loaded .emacs and Info-fontify-maximum-menu-size = 100000:

Function Name                     Call Count  Elapsed Time  Average Time
================================  ==========  ============  ============
Info-follow-nearest-node          1           18.451064     18.451064
Info-try-follow-nearest-node      1           18.450906     18.450906
Info-goto-node                    1           18.449308     18.449308
Info-find-node                    1           18.449179     18.449179
Info-find-node-2                  1           18.431969     18.431969
Info-select-node                  1           18.39279      18.39279
Info-fontify-node                 1           18.388963     18.388963
put-text-property                 1559        5.4653120000  0.0035056523
re-search-forward                 730         0.0564030000  7.726...e-05
info-insert-file-contents         2           0.0362220000  0.0181110000
Info-read-subfile                 1           0.028904      0.028904
match-string                      1908        0.0194390000  1.018...e-05
Info-find-file                    1           0.017144      0.017144
add-text-properties               1266        0.0143140000  1.130...e-05
match-end                         5447        0.0123990000  2.276...e-06
info-file-exists-p                145         0.0105809999  7.297...e-05
looking-at                        1409        0.0097819999  6.942...e-06
match-beginning                   3356        0.0080770000  2.406...e-06
Info-index-node                   3           0.005018      0.0016726666
Info-display-images-node          1           0.001014      0.001014
Info-hide-cookies-node            1           0.000979      0.000979
Info-get-token                    4           0.0009629999  0.0002407499
info-insert-file-contents-1       143         0.0006999999  4.895...e-06
Info-find-node-in-buffer          1           0.000264      0.000264
Info-find-node-in-buffer-1        1           0.000241      0.000241
Info-find-in-tag-table            1           0.000229      0.000229
Info-find-in-tag-table-1          2           0.0001999999  9.999...e-05
Info-extract-menu-node-name       1           0.00019       0.00019
Info-set-mode-line                1           0.000182      0.000182
Info-escape-percent               1           9.8e-05       9.8e-05
replace-regexp-in-string          1           6e-05         6e-05
Info-following-node-name-re       1           1.3e-05       1.3e-05
Info-node-at-bob-matching         1           9e-06         9e-06
info-initialize                   2           6e-06         3e-06

With loaded .emacs and Info-fontify-maximum-menu-size = 0:

Function Name                     Call Count  Elapsed Time  Average Time
================================  ==========  ============  ============
Info-follow-nearest-node          1           0.060599      0.060599
Info-try-follow-nearest-node      1           0.060563      0.060563
Info-goto-node                    1           0.058121      0.058121
Info-find-node                    1           0.057991      0.057991
Info-find-node-2                  1           0.046453      0.046453
info-insert-file-contents         2           0.027276      0.013638
Info-read-subfile                 1           0.024617      0.024617
re-search-forward                 96          0.0177140000  0.0001845208
Info-select-node                  1           0.0177        0.0177
Info-fontify-node                 1           0.014428      0.014428
Info-find-file                    1           0.011469      0.011469
info-file-exists-p                145         0.008243      5.684...e-05
Info-get-token                    4           0.001839      0.00045975
looking-at                        44          0.0013139999  2.986...e-05
Info-index-node                   3           0.001055      0.0003516666
put-text-property                 92          0.0008159999  8.869...e-06
Info-display-images-node          1           0.000754      0.000754
Info-hide-cookies-node            1           0.00073       0.00073
info-insert-file-contents-1       143         0.0006709999  4.692...e-06
Info-find-node-in-buffer          1           0.000286      0.000286
Info-find-node-in-buffer-1        1           0.000263      0.000263
Info-find-in-tag-table            1           0.000231      0.000231
Info-find-in-tag-table-1          2           0.000202      0.000101
match-beginning                   86          0.0001779999  2.069...e-06
Info-extract-menu-node-name       1           0.000159      0.000159
match-end                         86          0.0001589999  1.848...e-06
Info-set-mode-line                1           0.000126      0.000126
Info-escape-percent               1           0.000121      0.000121
match-string                      9           6.6e-05       7.333...e-06
replace-regexp-in-string          1           4.2e-05       4.2e-05
Info-following-node-name-re       1           1.2e-05       1.2e-05
Info-node-at-bob-matching         1           1e-05         1e-05
info-initialize                   2           8.000...e-06  4.000...e-06

These results indicate that the main source of the slowdown is the
menu items fontification code in `Info-fontify-node', and it is caused
by a large amount of Info menu items needed to be processed.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2005-06-11 23:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-10 23:27 Info is slow in Emacs 22.0.50 Nick Roberts
2005-06-10 23:45 ` Luc Teirlinck
2005-06-11  9:59   ` Nick Roberts
2005-06-11 23:18     ` Juri Linkov
2005-06-12  2:31       ` Nick Roberts
2005-06-12  8:51         ` Eli Zaretskii
2005-06-13  1:50           ` Nick Roberts
2005-06-13  2:19             ` Luc Teirlinck
2005-06-13  2:54               ` Nick Roberts
2005-06-11 12:52 ` Eli Zaretskii
2005-06-11 23:18   ` Juri Linkov [this message]
2005-06-12 16:47     ` Stefan Monnier
2005-06-13  6:08       ` Juri Linkov
2005-06-12 19:58     ` Richard Stallman
2005-06-13  6:07       ` Juri Linkov
2005-06-13 23:39         ` Richard Stallman
2005-06-11 23:16 ` Richard Stallman

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=87psusmk0u.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=nickrob@snap.net.nz \
    /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).