emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Huge performance problems to open some Org files
@ 2010-12-17  9:15 Sébastien Vauban
  2010-12-17 10:11 ` Rainer Stengele
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Sébastien Vauban @ 2010-12-17  9:15 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

Hello,

I've real performance problems for opening some Org files. Just some,
hopefully. I don't remember having those problems when I was on Ubuntu, and I
must already have opened it, back then, but... Anyway, I'm now (forced) on
Windows, and I have the problem.

For example[fn:1], the small attached file takes me at least 6 s for opening it!
I really have no idea why. Why is it different from others, longer, that are
opened in a much shorter time?

What did I do to try to spot the problem?

    M-x elp-instrument-package RET org- RET
    M-x find-file <FILE> RET
    M-x elp-results.

Here they are:

#+begin_src emacs-lisp
org-mode                                                      1           6.719         6.719
org-set-regexps-and-options                                   1           0.203         0.203
org-compute-latex-and-specials-regexp                         1           0.203         0.203
org-match-string-no-properties                                35          0.016         0.0004571428
org-infile-export-plist                                       2           0.016         0.008
org-all-targets                                               1           0.0           0.0
org-mode-p                                                    13          0.0           0.0
org-babel-result-hide-spec                                    1           0.0           0.0
org-inlinetask-fontify                                        2           0.0           0.0
org-bookmark-jump-unhide                                      1           0.0           0.0
org-cycle                                                     1           0.0           0.0
org-unfontify-region                                          2           0.0           0.0
org-agenda-files                                              1           0.0           0.0
org-raise-scripts                                             2           0.0           0.0
org-activate-dates                                            2           0.0           0.0
org-point-at-end-of-empty-headline                            1           0.0           0.0
org-load-modules-maybe                                        2           0.0           0.0
org-get-indentation                                           1           0.0           0.0
org-remove-font-lock-display-properties                       2           0.0           0.0
org-mode-flyspell-verify                                      1           0.0           0.0
org-clocking-p                                                1           0.0           0.0
org-activate-footnote-links                                   2           0.0           0.0
org-at-item-checkbox-p                                        1           0.0           0.0
org-propertize                                                4           0.0           0.0
org-babel-do-key-sequence-in-edit-buffer                      1           0.0           0.0
org-set-startup-visibility                                    1           0.0           0.0
org-overview                                                  1           0.0           0.0
org-resolve-clocks-if-idle                                    1           0.0           0.0
org-decompose-region                                          2           0.0           0.0
org-make-options-regexp                                       3           0.0           0.0
org-update-radio-target-regexp                                1           0.0           0.0
org-font-lock-add-priority-faces                              2           0.0           0.0
org-assign-fast-keys                                          1           0.0           0.0
org-extract-log-state-settings                                16          0.0           0.0
org-install-agenda-files-menu                                 1           0.0           0.0
org-babel-where-is-src-block-head                             1           0.0           0.0
org-do-latex-and-special-faces                                2           0.0           0.0
org-cycle-internal-global                                     1           0.0           0.0
org-do-emphasis-faces                                         2           0.0           0.0
org-link-display-format                                       3           0.0           0.0
org-src-native-tab-command-maybe                              1           0.0           0.0
org-fontify-entities                                          2           0.0           0.0
org-file-menu-entry                                           32          0.0           0.0
org-set-visibility-according-to-property                      1           0.0           0.0
org-activate-bracket-links                                    2           0.0           0.0
org-hide-archived-subtrees                                    1           0.0           0.0
org-imenu-new-marker                                          3           0.0           0.0
org-delete-all                                                1           0.0           0.0
org-add-props                                                 3           0.0           0.0
org-cycle-hide-drawers                                        2           0.0           0.0
org-clocking-buffer                                           1           0.0           0.0
org-hh:mm-string-to-minutes                                   2           0.0           0.0
org-combine-plists                                            1           0.0           0.0
org-cycle-item-indentation                                    1           0.0           0.0
org-clock-notify-once-if-expired                              1           0.0           0.0
org-optimize-window-after-visibility-change                   1           0.0           0.0
org-list-at-regexp-after-bullet-p                             2           0.0           0.0
org-set-font-lock-defaults                                    1           0.0           0.0
org-make-target-link-regexp                                   1           0.0           0.0
org-cycle-level                                               1           0.0           0.0
org-fontify-meta-lines-and-blocks                             10          0.0           0.0
org-babel-hide-result-toggle-maybe                            1           0.0           0.0
org-float-time                                                4           0.0           0.0
org-activate-angle-links                                      2           0.0           0.0
org-hide-block-toggle-maybe                                   1           0.0           0.0
org-clock-load                                                1           0.0           0.0
org-activate-code                                             2           0.0           0.0
org-font-lock-hook                                            2           0.0           0.0
org-set-autofill-regexps                                      1           0.0           0.0
org-cycle-show-empty-lines                                    2           0.0           0.0
org-activate-target-links                                     2           0.0           0.0
org-set-local                                                 35          0.0           0.0
org-clock-update-mode-line                                    1           0.0           0.0
org-defkey                                                    7           0.0           0.0
org-clock-get-clock-string                                    1           0.0           0.0
org-restart-font-lock                                         1           0.0           0.0
org-add-hook                                                  4           0.0           0.0
org-remove-keyword-keys                                       3           0.0           0.0
org-activate-plain-links                                      2           0.0           0.0
org-font-lock-add-tag-faces                                   2           0.0           0.0
org-cycle-hide-archived-subtrees                              2           0.0           0.0
org-at-table-p                                                1           0.0           0.0
org-hide-wide-columns                                         2           0.0           0.0
org-imenu-get-tree                                            1           0.0           0.0
org-key                                                       7           0.0           0.0
org-at-item-p                                                 4           0.0           0.0
org-babel-hide-all-hashes                                     1           0.0           0.0
org-default-export-plist                                      1           0.0           0.0
org-activate-tags                                             2           0.0           0.0
org-reduced-level                                             3           0.0           0.0
org-at-item-description-p                                     1           0.0           0.0
org-outline-level                                             7           0.0           0.0
org-clock-get-clocked-time                                    2           0.0           0.0
org-last                                                      3           0.0           0.0
org-invisible-p                                               2           0.0           0.0
org-get-level-face                                            3           0.0           0.0
#+end_src

which confirms almost 7 s for just opening that small file into a buffer.

Though, I don't see any potential explanation therefore. Could you help me
spotting the problem?

Best regards,
  Seb

* Footnotes
[fn:1] I even have (longer) files that take longer to open...

-- 
Sébastien Vauban

[-- Attachment #2: tags-opening-it-is-sloooooooooow.org --]
[-- Type: text/org, Size: 2187 bytes --]

#+TITLE:     Tags FIXME
#+AUTHOR:    Fabrice Niessen
#+EMAIL:     fni-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org
#+DATE:      2010-07-08
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en_US

#+STYLE:        <style type="text/css">a#current-tags { background: url('http://www.mygooglest.com/fni/pic/current.gif') no-repeat; background-position: 101% center; cursor: text;}</style>

This page is useless for you. It's only for me, for testing some code.

Ce texte est en français.
This is in English.
Estando en español.

* Environments

The following are different environments, from the best to the less good...
The worse are not even shown ;-)

See http://orgmode.org/manual/Literal-examples.html#Literal-examples.

** Src with highlighting

   #+BEGIN_SRC sh
   #!/bin/sh
   #!/bin/sh 123456789 223456789 333456789 444456789 555556789 666666789 777777789 888888889 999999999 000000000 000000000
   # script -- What it does
   # Exits with zero if no error. Looooooonnnng comment... 0123 4567 8901 2345 6789 0123 abcd efgh ijkl mnop qrst uvwx yz01 2345 6789 0abc

   tempfile="/tmp/$(basename $0).tmp"

   # 80 chars exactly =============================================================

   trap "/bin/rm -f $tempfile" EXIT HUP INT QUIT TERM

   function usage()
   {
     cat << EOF >&2
   Usage: $(basename $0) flags...
   Where...
   EOF
     exit 1
   }

   if [ $# -eq 0 ]; then
     usage
   fi
   #+END_SRC

** Example

   #+BEGIN_EXAMPLE
   #!/bin/sh
   #!/bin/sh 123456789 223456789 333456789 444456789 555556789 666666789 777777789 888888889 999999999 000000000 000000000
   # script -- What it does
   # Exits with zero if no error. Looooooonnnng comment... 0123 4567 8901 2345 6789 0123 abcd efgh ijkl mnop qrst uvwx yz01 2345 6789 0abc

   tempfile="/tmp/$(basename $0).tmp"

   # 80 chars exactly =============================================================

   trap "/bin/rm -f $tempfile" EXIT HUP INT QUIT TERM

   function usage()
   {
     cat << EOF >&2
   Usage: $(basename $0) flags...
   Where...
   EOF
     exit 1
   }

   if [ $# -eq 0 ]; then
     usage
   fi
   #+END_EXAMPLE

[-- Attachment #3: Type: text/plain, Size: 222 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17  9:15 Huge performance problems to open some Org files Sébastien Vauban
@ 2010-12-17 10:11 ` Rainer Stengele
  2010-12-17 10:44   ` Sébastien Vauban
  2010-12-17 12:17 ` Andrew J. Korty
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Rainer Stengele @ 2010-12-17 10:11 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: public-emacs-orgmode-mXXj517/zsQ

Am 17.12.2010 10:15, schrieb Sébastien Vauban:
> Hello,
> 
> I've real performance problems for opening some Org files. Just some,
> hopefully. I don't remember having those problems when I was on Ubuntu, and I
> must already have opened it, back then, but... Anyway, I'm now (forced) on
> Windows, and I have the problem.
> 
> For example[fn:1], the small attached file takes me at least 6 s for opening it!
> I really have no idea why. Why is it different from others, longer, that are
> opened in a much shorter time?
> 
> What did I do to try to spot the problem?
> 
>     M-x elp-instrument-package RET org- RET
>     M-x find-file <FILE> RET
>     M-x elp-results.
> 
> Here they are:
> 
> #+begin_src emacs-lisp
> org-mode                                                      1           6.719         6.719
> org-set-regexps-and-options                                   1           0.203         0.203
> org-compute-latex-and-specials-regexp                         1           0.203         0.203
> org-match-string-no-properties                                35          0.016         0.0004571428
> org-infile-export-plist                                       2           0.016         0.008
> org-all-targets                                               1           0.0           0.0
> org-mode-p                                                    13          0.0           0.0
> org-babel-result-hide-spec                                    1           0.0           0.0
> org-inlinetask-fontify                                        2           0.0           0.0
> org-bookmark-jump-unhide                                      1           0.0           0.0
> org-cycle                                                     1           0.0           0.0
> org-unfontify-region                                          2           0.0           0.0
> org-agenda-files                                              1           0.0           0.0
> org-raise-scripts                                             2           0.0           0.0
> org-activate-dates                                            2           0.0           0.0
> org-point-at-end-of-empty-headline                            1           0.0           0.0
> org-load-modules-maybe                                        2           0.0           0.0
> org-get-indentation                                           1           0.0           0.0
> org-remove-font-lock-display-properties                       2           0.0           0.0
> org-mode-flyspell-verify                                      1           0.0           0.0
> org-clocking-p                                                1           0.0           0.0
> org-activate-footnote-links                                   2           0.0           0.0
> org-at-item-checkbox-p                                        1           0.0           0.0
> org-propertize                                                4           0.0           0.0
> org-babel-do-key-sequence-in-edit-buffer                      1           0.0           0.0
> org-set-startup-visibility                                    1           0.0           0.0
> org-overview                                                  1           0.0           0.0
> org-resolve-clocks-if-idle                                    1           0.0           0.0
> org-decompose-region                                          2           0.0           0.0
> org-make-options-regexp                                       3           0.0           0.0
> org-update-radio-target-regexp                                1           0.0           0.0
> org-font-lock-add-priority-faces                              2           0.0           0.0
> org-assign-fast-keys                                          1           0.0           0.0
> org-extract-log-state-settings                                16          0.0           0.0
> org-install-agenda-files-menu                                 1           0.0           0.0
> org-babel-where-is-src-block-head                             1           0.0           0.0
> org-do-latex-and-special-faces                                2           0.0           0.0
> org-cycle-internal-global                                     1           0.0           0.0
> org-do-emphasis-faces                                         2           0.0           0.0
> org-link-display-format                                       3           0.0           0.0
> org-src-native-tab-command-maybe                              1           0.0           0.0
> org-fontify-entities                                          2           0.0           0.0
> org-file-menu-entry                                           32          0.0           0.0
> org-set-visibility-according-to-property                      1           0.0           0.0
> org-activate-bracket-links                                    2           0.0           0.0
> org-hide-archived-subtrees                                    1           0.0           0.0
> org-imenu-new-marker                                          3           0.0           0.0
> org-delete-all                                                1           0.0           0.0
> org-add-props                                                 3           0.0           0.0
> org-cycle-hide-drawers                                        2           0.0           0.0
> org-clocking-buffer                                           1           0.0           0.0
> org-hh:mm-string-to-minutes                                   2           0.0           0.0
> org-combine-plists                                            1           0.0           0.0
> org-cycle-item-indentation                                    1           0.0           0.0
> org-clock-notify-once-if-expired                              1           0.0           0.0
> org-optimize-window-after-visibility-change                   1           0.0           0.0
> org-list-at-regexp-after-bullet-p                             2           0.0           0.0
> org-set-font-lock-defaults                                    1           0.0           0.0
> org-make-target-link-regexp                                   1           0.0           0.0
> org-cycle-level                                               1           0.0           0.0
> org-fontify-meta-lines-and-blocks                             10          0.0           0.0
> org-babel-hide-result-toggle-maybe                            1           0.0           0.0
> org-float-time                                                4           0.0           0.0
> org-activate-angle-links                                      2           0.0           0.0
> org-hide-block-toggle-maybe                                   1           0.0           0.0
> org-clock-load                                                1           0.0           0.0
> org-activate-code                                             2           0.0           0.0
> org-font-lock-hook                                            2           0.0           0.0
> org-set-autofill-regexps                                      1           0.0           0.0
> org-cycle-show-empty-lines                                    2           0.0           0.0
> org-activate-target-links                                     2           0.0           0.0
> org-set-local                                                 35          0.0           0.0
> org-clock-update-mode-line                                    1           0.0           0.0
> org-defkey                                                    7           0.0           0.0
> org-clock-get-clock-string                                    1           0.0           0.0
> org-restart-font-lock                                         1           0.0           0.0
> org-add-hook                                                  4           0.0           0.0
> org-remove-keyword-keys                                       3           0.0           0.0
> org-activate-plain-links                                      2           0.0           0.0
> org-font-lock-add-tag-faces                                   2           0.0           0.0
> org-cycle-hide-archived-subtrees                              2           0.0           0.0
> org-at-table-p                                                1           0.0           0.0
> org-hide-wide-columns                                         2           0.0           0.0
> org-imenu-get-tree                                            1           0.0           0.0
> org-key                                                       7           0.0           0.0
> org-at-item-p                                                 4           0.0           0.0
> org-babel-hide-all-hashes                                     1           0.0           0.0
> org-default-export-plist                                      1           0.0           0.0
> org-activate-tags                                             2           0.0           0.0
> org-reduced-level                                             3           0.0           0.0
> org-at-item-description-p                                     1           0.0           0.0
> org-outline-level                                             7           0.0           0.0
> org-clock-get-clocked-time                                    2           0.0           0.0
> org-last                                                      3           0.0           0.0
> org-invisible-p                                               2           0.0           0.0
> org-get-level-face                                            3           0.0           0.0
> #+end_src
> 
> which confirms almost 7 s for just opening that small file into a buffer.
> 
> Though, I don't see any potential explanation therefore. Could you help me
> spotting the problem?
> 
> Best regards,
>   Seb
> 
> * Footnotes
> [fn:1] I even have (longer) files that take longer to open...
> 
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Sebastian,

loading the file I get

org-mode                                                      2           0.078         0.039
org-agenda-files                                              2           0.047         0.0235
org-install-agenda-files-menu                                 2           0.047         0.0235
org-all-targets                                               2           0.0           0.0
org-babel-result-hide-spec                                    2           0.0           0.0
org-end-of-subtree                                            2           0.0           0.0
org-bookmark-jump-unhide                                      1           0.0           0.0
org-show-block-all                                            1           0.0           0.0

which is "no time". I am using

GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-11-04 on LENNART-69DE564 (patched)
Org-mode version 7.4 (release_7.4.57.gab22)

on Windows XP, SP3.

Doesn't help much I know but I do not think it is Windows related.

- Rainer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17 10:11 ` Rainer Stengele
@ 2010-12-17 10:44   ` Sébastien Vauban
  0 siblings, 0 replies; 13+ messages in thread
From: Sébastien Vauban @ 2010-12-17 10:44 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Rainer,

Rainer Stengele wrote:
> Am 17.12.2010 10:15, schrieb Sébastien Vauban:
>> I've real performance problems for opening some Org files. Just some,
>> hopefully. I don't remember having those problems when I was on Ubuntu, and
>> I must already have opened it, back then, but... Anyway, I'm now (forced)
>> on Windows, and I have the problem.
>>
>> For example[fn:1], the small attached file takes me at least 6 s for
>> opening it! I really have no idea why. Why is it different from others,
>> longer, that are opened in a much shorter time?
>>
>> What did I do to try to spot the problem?
>>
>>     M-x elp-instrument-package RET org- RET
>>     M-x find-file <FILE> RET
>>     M-x elp-results.
>>
>> Here they are:
>>
>> org-mode                                                      1           6.719         6.719
>> [...]
>> org-all-targets                                               1           0.0           0.0
>> [...]
>> org-babel-result-hide-spec                                    1           0.0           0.0
>> [...]
>> org-bookmark-jump-unhide                                      1           0.0           0.0
>> [...]
>> org-agenda-files                                              1           0.0           0.0
>> [...]
>> org-install-agenda-files-menu                                 1           0.0           0.0
>>
>> which confirms almost 7 s for just opening that small file into a buffer.
>>
>> Though, I don't see any potential explanation therefore. Could you help me
>> spotting the problem?
>
> loading the file I get
>
> org-mode                                                      2           0.078         0.039
> org-agenda-files                                              2           0.047         0.0235
> org-install-agenda-files-menu                                 2           0.047         0.0235
> org-all-targets                                               2           0.0           0.0
> org-babel-result-hide-spec                                    2           0.0           0.0
> org-end-of-subtree                                            2           0.0           0.0
> org-bookmark-jump-unhide                                      1           0.0           0.0
> org-show-block-all                                            1           0.0           0.0
>
> which is "no time".

Absolutely. Thanks for having taken time to test it, and report it!

What is a bit weird, though, is that the count number is different:

- you have 2 calls of org-mode and 1 of org-bookmark-jump-unhide
- I have 1 call of both...

> I am using
>
> GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-11-04 on LENNART-69DE564 (patched)
> Org-mode version 7.4 (release_7.4.57.gab22)
>
> on Windows XP, SP3.
>
> Doesn't help much I know but I do not think it is Windows related.

Good to hear. I'm using

GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-10-14 on LENNART-69DE564 (patched)
Org-mode version 7.4 (release_7.4.29.gc61cd)

on Windows XP, Media Center Edition, Version 2002, SP3
on Sony VAIO 2-Core @ 1,83GHz with 2,00 GB RAM.

Very similar to your config (at least, for Emacs/Org)...

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17  9:15 Huge performance problems to open some Org files Sébastien Vauban
  2010-12-17 10:11 ` Rainer Stengele
@ 2010-12-17 12:17 ` Andrew J. Korty
  2010-12-17 12:29 ` Carsten Dominik
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Andrew J. Korty @ 2010-12-17 12:17 UTC (permalink / raw)
  To: emacs-orgmode

Do you have flyspell-mode enabled?  It caused such a performance hit I 
had to disable it for org files.

ajk

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17  9:15 Huge performance problems to open some Org files Sébastien Vauban
  2010-12-17 10:11 ` Rainer Stengele
  2010-12-17 12:17 ` Andrew J. Korty
@ 2010-12-17 12:29 ` Carsten Dominik
  2010-12-17 13:26   ` Sébastien Vauban
  2010-12-17 15:46 ` Nick Dokos
  2010-12-17 21:55 ` Achim Gratz
  4 siblings, 1 reply; 13+ messages in thread
From: Carsten Dominik @ 2010-12-17 12:29 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Hi Sebastien,

it seems clear that it is not orgmode that causes the
delays in its own functions.

One way to find out what is goin on is this:

Turn on debug-on-quite.

The, when in this slow loading process, press C-g at random times and  
see
look at the functions in the backtrace.  Instrument these functions or  
better packages with epl as well and iterate until you find which  
functions eat up the time.

vc- stuff version control may be one likely offender.

- Carsten

On Dec 17, 2010, at 10:15 AM, Sébastien Vauban wrote:

> Hello,
>
> I've real performance problems for opening some Org files. Just some,
> hopefully. I don't remember having those problems when I was on  
> Ubuntu, and I
> must already have opened it, back then, but... Anyway, I'm now  
> (forced) on
> Windows, and I have the problem.
>
> For example[fn:1], the small attached file takes me at least 6 s for  
> opening it!
> I really have no idea why. Why is it different from others, longer,  
> that are
> opened in a much shorter time?
>
> What did I do to try to spot the problem?
>
>    M-x elp-instrument-package RET org- RET
>    M-x find-file <FILE> RET
>    M-x elp-results.
>
> Here they are:
>
> #+begin_src emacs-lisp
> org-mode                                                       
> 1           6.719         6.719
> org-set-regexps-and-options                                    
> 1           0.203         0.203
> org-compute-latex-and-specials-regexp                          
> 1           0.203         0.203
> org-match-string-no-properties                                 
> 35          0.016         0.0004571428
> org-infile-export-plist                                        
> 2           0.016         0.008
> org-all-targets                                                
> 1           0.0           0.0
> org-mode-p                                                     
> 13          0.0           0.0
> org-babel-result-hide-spec                                     
> 1           0.0           0.0
> org-inlinetask-fontify                                         
> 2           0.0           0.0
> org-bookmark-jump-unhide                                       
> 1           0.0           0.0
> org-cycle                                                      
> 1           0.0           0.0
> org-unfontify-region                                           
> 2           0.0           0.0
> org-agenda-files                                               
> 1           0.0           0.0
> org-raise-scripts                                              
> 2           0.0           0.0
> org-activate-dates                                             
> 2           0.0           0.0
> org-point-at-end-of-empty-headline                             
> 1           0.0           0.0
> org-load-modules-maybe                                         
> 2           0.0           0.0
> org-get-indentation                                            
> 1           0.0           0.0
> org-remove-font-lock-display-properties                        
> 2           0.0           0.0
> org-mode-flyspell-verify                                       
> 1           0.0           0.0
> org-clocking-p                                                 
> 1           0.0           0.0
> org-activate-footnote-links                                    
> 2           0.0           0.0
> org-at-item-checkbox-p                                         
> 1           0.0           0.0
> org-propertize                                                 
> 4           0.0           0.0
> org-babel-do-key-sequence-in-edit-buffer                       
> 1           0.0           0.0
> org-set-startup-visibility                                     
> 1           0.0           0.0
> org-overview                                                   
> 1           0.0           0.0
> org-resolve-clocks-if-idle                                     
> 1           0.0           0.0
> org-decompose-region                                           
> 2           0.0           0.0
> org-make-options-regexp                                        
> 3           0.0           0.0
> org-update-radio-target-regexp                                 
> 1           0.0           0.0
> org-font-lock-add-priority-faces                               
> 2           0.0           0.0
> org-assign-fast-keys                                           
> 1           0.0           0.0
> org-extract-log-state-settings                                 
> 16          0.0           0.0
> org-install-agenda-files-menu                                  
> 1           0.0           0.0
> org-babel-where-is-src-block-head                              
> 1           0.0           0.0
> org-do-latex-and-special-faces                                 
> 2           0.0           0.0
> org-cycle-internal-global                                      
> 1           0.0           0.0
> org-do-emphasis-faces                                          
> 2           0.0           0.0
> org-link-display-format                                        
> 3           0.0           0.0
> org-src-native-tab-command-maybe                               
> 1           0.0           0.0
> org-fontify-entities                                           
> 2           0.0           0.0
> org-file-menu-entry                                            
> 32          0.0           0.0
> org-set-visibility-according-to-property                       
> 1           0.0           0.0
> org-activate-bracket-links                                     
> 2           0.0           0.0
> org-hide-archived-subtrees                                     
> 1           0.0           0.0
> org-imenu-new-marker                                           
> 3           0.0           0.0
> org-delete-all                                                 
> 1           0.0           0.0
> org-add-props                                                  
> 3           0.0           0.0
> org-cycle-hide-drawers                                         
> 2           0.0           0.0
> org-clocking-buffer                                            
> 1           0.0           0.0
> org-hh:mm-string-to-minutes                                    
> 2           0.0           0.0
> org-combine-plists                                             
> 1           0.0           0.0
> org-cycle-item-indentation                                     
> 1           0.0           0.0
> org-clock-notify-once-if-expired                               
> 1           0.0           0.0
> org-optimize-window-after-visibility-change                    
> 1           0.0           0.0
> org-list-at-regexp-after-bullet-p                              
> 2           0.0           0.0
> org-set-font-lock-defaults                                     
> 1           0.0           0.0
> org-make-target-link-regexp                                    
> 1           0.0           0.0
> org-cycle-level                                                
> 1           0.0           0.0
> org-fontify-meta-lines-and-blocks                              
> 10          0.0           0.0
> org-babel-hide-result-toggle-maybe                             
> 1           0.0           0.0
> org-float-time                                                 
> 4           0.0           0.0
> org-activate-angle-links                                       
> 2           0.0           0.0
> org-hide-block-toggle-maybe                                    
> 1           0.0           0.0
> org-clock-load                                                 
> 1           0.0           0.0
> org-activate-code                                              
> 2           0.0           0.0
> org-font-lock-hook                                             
> 2           0.0           0.0
> org-set-autofill-regexps                                       
> 1           0.0           0.0
> org-cycle-show-empty-lines                                     
> 2           0.0           0.0
> org-activate-target-links                                      
> 2           0.0           0.0
> org-set-local                                                  
> 35          0.0           0.0
> org-clock-update-mode-line                                     
> 1           0.0           0.0
> org-defkey                                                     
> 7           0.0           0.0
> org-clock-get-clock-string                                     
> 1           0.0           0.0
> org-restart-font-lock                                          
> 1           0.0           0.0
> org-add-hook                                                   
> 4           0.0           0.0
> org-remove-keyword-keys                                        
> 3           0.0           0.0
> org-activate-plain-links                                       
> 2           0.0           0.0
> org-font-lock-add-tag-faces                                    
> 2           0.0           0.0
> org-cycle-hide-archived-subtrees                               
> 2           0.0           0.0
> org-at-table-p                                                 
> 1           0.0           0.0
> org-hide-wide-columns                                          
> 2           0.0           0.0
> org-imenu-get-tree                                             
> 1           0.0           0.0
> org-key                                                        
> 7           0.0           0.0
> org-at-item-p                                                  
> 4           0.0           0.0
> org-babel-hide-all-hashes                                      
> 1           0.0           0.0
> org-default-export-plist                                       
> 1           0.0           0.0
> org-activate-tags                                              
> 2           0.0           0.0
> org-reduced-level                                              
> 3           0.0           0.0
> org-at-item-description-p                                      
> 1           0.0           0.0
> org-outline-level                                              
> 7           0.0           0.0
> org-clock-get-clocked-time                                     
> 2           0.0           0.0
> org-last                                                       
> 3           0.0           0.0
> org-invisible-p                                                
> 2           0.0           0.0
> org-get-level-face                                             
> 3           0.0           0.0
> #+end_src
>
> which confirms almost 7 s for just opening that small file into a  
> buffer.
>
> Though, I don't see any potential explanation therefore. Could you  
> help me
> spotting the problem?
>
> Best regards,
>  Seb
>
> * Footnotes
> [fn:1] I even have (longer) files that take longer to open...
>
> -- 
> Sébastien Vauban
> <tags-opening-it-is- 
> sloooooooooow.org>_______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17 12:29 ` Carsten Dominik
@ 2010-12-17 13:26   ` Sébastien Vauban
  2010-12-20 19:29     ` Vladimir Alexiev
  0 siblings, 1 reply; 13+ messages in thread
From: Sébastien Vauban @ 2010-12-17 13:26 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Carsten,

Carsten Dominik wrote:
> Hi Sebastien,
>
> it seems clear that it is not orgmode that causes the delays in its own
> functions.

I don't have any doubt on that. Org is only the top of the iceberg.


> One way to find out what is goin on is this:
>
> Turn on debug-on-quite.
>
> The, when in this slow loading process, press C-g at random times and see
> look at the functions in the backtrace.  Instrument these functions or better
> packages with epl as well and iterate until you find which  functions eat up
> the time.

Believe me or not, but C-g has not effect during those 7 seconds. It simply
does not stop anything; it's like if it was simply ignored. So, the above is
impossible to do in this case.


> vc- stuff version control may be one likely offender.

I have all my files under either Git or Svn -- no performance problem
(noticed) for almost all of them. This one is somehow "special".

I've eliminated flyspell from the possible culprits by instrumenting it, and
seeing it does do "nothing"...

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17  9:15 Huge performance problems to open some Org files Sébastien Vauban
                   ` (2 preceding siblings ...)
  2010-12-17 12:29 ` Carsten Dominik
@ 2010-12-17 15:46 ` Nick Dokos
  2010-12-17 21:55 ` Achim Gratz
  4 siblings, 0 replies; 13+ messages in thread
From: Nick Dokos @ 2010-12-17 15:46 UTC (permalink / raw)
  To: =?utf-8?Q?S=C3=A9bastien_Vauban?=; +Cc: nicholas.dokos, emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:

> 
> Though, I don't see any potential explanation therefore. Could you help me
> spotting the problem?
> 

It looks as if something that org-mode calls is taking all the time,
but it is not org itself. So the next thing is to look at what org-mode
calls and try to profile those packages. This is a complete shot in the
dark, but I'd start with font-lock.

Nick

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17  9:15 Huge performance problems to open some Org files Sébastien Vauban
                   ` (3 preceding siblings ...)
  2010-12-17 15:46 ` Nick Dokos
@ 2010-12-17 21:55 ` Achim Gratz
  4 siblings, 0 replies; 13+ messages in thread
From: Achim Gratz @ 2010-12-17 21:55 UTC (permalink / raw)
  To: emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com>
writes:

> I've real performance problems for opening some Org files. Just some,
> hopefully. I don't remember having those problems when I was on Ubuntu, and I
> must already have opened it, back then, but... Anyway, I'm now (forced) on
> Windows, and I have the problem.

I don't think org itself is to blame, but I can think of two things that
may produce such a performance hit:

1) If the file is under version control, specifically git, the file stat
operations take very long on Windows since Windows' idea of file state
needs to be translated to POSIX semantics.  Not only that, they take
very long each time you open or save that file since they aren't
cacheable (TortoiseGit tries to do it anyway, but that cache daemon
likes to crash very frequently).  MSysGit is faster than Cygwin, but
still much slower than anything you know from Linux.

2) Another thing I've hit on in the past is not really Windows specific:
if your document uses characters that your standard font does not
encode, a search for a replacement font with that character is started
the first time each of those characters is found.  Depending on how many
fonts are installed and what the search order is, this can take a very
long time.  However, the second and following times of opening that
document in the same session is then much faster.


HTH,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-17 13:26   ` Sébastien Vauban
@ 2010-12-20 19:29     ` Vladimir Alexiev
  2011-05-12 22:27       ` Sebastien Vauban
  0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Alexiev @ 2010-12-20 19:29 UTC (permalink / raw)
  To: emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@...> writes:

> Believe me or not, but C-g has not effect during those 7 seconds. It simply
> does not stop anything

Sounds like emacs is waiting inside some blocking call, and waits until it times 
out. Likely a network call. Do you have any tramp/efs/angeftp stuff going on?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2010-12-20 19:29     ` Vladimir Alexiev
@ 2011-05-12 22:27       ` Sebastien Vauban
  2011-05-13  9:49         ` Eric S Fraga
  2011-05-13 10:15         ` Carsten Dominik
  0 siblings, 2 replies; 13+ messages in thread
From: Sebastien Vauban @ 2011-05-12 22:27 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

Hi Andrew, Vladimir, Nick, Achim, Carsten & al,

Vladimir Alexiev wrote:
> Sébastien Vauban <wxhgmqzgwmuf@...> writes:
>> Believe me or not, but C-g has not effect during those 7 seconds. It simply
>> does not stop anything
>
> Sounds like emacs is waiting inside some blocking call, and waits until it
> times out. Likely a network call. Do you have any tramp/efs/angeftp stuff
> going on?

This has gotten worse. But, now, I have some proofs about what I experience:
opening the attached Org file (2 KB) consumes me 191 seconds, yes 191 seconds,
even when done after the agenda view has been launched -- I mean, all agenda
files and all Org files have been read...

--8<---------------cut here---------------start------------->8---
| find-file | start |c:/home/sva/Public/tags-opening-it-is-sloooooooooow.org | ___ |
+-> Requiring `org-exp' (already loaded)
OVERVIEW in c:/home/sva/Public/tags-opening-it-is-sloooooooooow.org
Checking for library `filladapt'...
+-> Requiring `filladapt' (already loaded)
Checking for library `filladapt'... Found
+-> Requiring `outline-mode-easy-bindings' (already loaded)
+-> Requiring `bytecomp' (already loaded)
Checking for library `filladapt'...
+-> Requiring `filladapt' (already loaded)
Checking for library `filladapt'... Found
| find-file | stop | c:/home/sva/Public/tags-opening-it-is-sloooooooooow.org | 191.3 |
--8<---------------cut here---------------end--------------->8---

Note that the variance is 0.1 second, over 3 Emacs restarts!  Pretty
reproducible...

To obtain the above trace, I've added the following bits to my .emacs file:

#+begin_src emacs-lisp
         ;; redefine require to leave a trace of packages being loaded
         (if (not (fboundp 'orig-require))
             (fset 'orig-require (symbol-function 'require))
           (message "The code to redefine `require' should not be loaded twice"))

         (defvar my/require-depth 0)

         (defun require (feature &optional filename noerror)
           "Leave a trace of packages being loaded."
           (cond ((member feature features)
                  (message "%sRequiring `%s' (already loaded)"
                           (concat (make-string (* 2 my/require-depth) ? )
                                   "+-> ")
                           feature))
                 (t
                  (message "%sRequiring `%s'"
                           (concat (make-string (* 2 my/require-depth) ? )
                                   "+-> ")
                           feature)
                  (let ((my/require-depth (+ 1 my/require-depth)))
                    (orig-require feature filename noerror))
                  (message "%sRequiring `%s'...done"
                           (concat (make-string (* 2 my/require-depth) ? )
                                   "+-> ")
                           feature))))

      (defvar missing-packages-list nil
        "List of packages that `try-require' can't find.")

      ;; attempt to load a feature/library, failing silently
      (defun try-require (feature)
        "Attempt to load a library or module. Return true if the
      library given as argument is successfully loaded. If not, instead
      of an error, just add the package to a list of missing packages."
        (condition-case err
            ;; protected form
            (progn
              (message "Checking for library `%s'..." feature)
              (if (stringp feature)
                  (load-library feature)
                (require feature))
              (message "Checking for library `%s'... Found" feature))
          ;; error handler
          (file-error  ; condition
           (progn
             (message "Checking for library `%s'... Missing" feature)
             (add-to-list 'missing-packages-list feature 'append))
           nil)))

(defadvice find-file (around my-find-file activate)
  "Open FILENAME and report time spent."
  (let* ((my-filename (ad-get-arg 0))
         (find-file-time-start (float-time)))
    (message (concat "| find-file | start |" my-filename " | ___ |"))
    ad-do-it
    (message "| find-file | stop | %s | %.1f |"
             my-filename
             (- (float-time) find-file-time-start))))
#+end_src

Trying to profile:

#+begin_src emacs-lisp
  (elp-instrument-package "org")
  (elp-instrument-package "outline")
  (elp-instrument-package "font-lock")
  (elp-instrument-package "flyspell")
  (elp-instrument-package "bytecomp")
  (elp-instrument-package "color-theme")
  (elp-instrument-package "company")
  (elp-instrument-package "custom")
  (elp-instrument-package "files")
  (elp-instrument-package "filladapt")
  (elp-instrument-package "help-fns")
  (elp-instrument-package "ispell")
  (elp-instrument-package "outline-mode-easy-bindings"))
#+end_src

did not help finding the culprit:

--8<---------------cut here---------------start------------->8---
custom-declare-variable                                    1733        0.735         0.0004241200
flyspell-mode                                              51          0.4210000000  0.0082549019
flyspell-post-command-hook                                 10          0.3759999999  0.0375999999
custom-initialize-default                                  33          0.375         0.0113636363
flyspell-word                                              9           0.3609999999  0.0401111111
outline-back-to-heading                                    5684        0.3430000000  6.03...e-005
custom-initialize-reset                                    1699        0.3280000000  0.0001930547
flyspell-mode-on                                           50          0.281         0.0056200000
ispell-init-process                                        98          0.265         0.0027040816
flyspell-accept-buffer-local-defs                          107         0.251         0.0023457943
ispell-accept-buffer-local-defs                            98          0.251         0.0025612244
outline-map-region                                         47          0.2200000000  0.0046808510
custom-declare-face                                        133         0.2190000000  0.0016466165
ispell-accept-output                                       2           0.2019999999  0.1009999999
outline-next-heading                                       5095        0.1720000000  3.37...e-005
font-lock-set-defaults                                     580         0.125         0.0002155172
font-lock-add-keywords                                     226         0.125         0.0005530973
font-lock-compile-keywords                                 180         0.125         0.0006944444
ispell-buffer-local-words                                  98          0.125         0.0012755102
ispell-buffer-local-parsing                                97          0.0939999999  0.0009690721
color-theme-install-faces                                  1           0.0779999999  0.0779999999
color-theme-install                                        1           0.0779999999  0.0779999999
color-theme-leuven                                         1           0.0779999999  0.0779999999
font-lock-default-fontify-region                           24          0.077         0.0032083333
font-lock-fontify-keywords-region                          24          0.077         0.0032083333
font-lock-fontify-region                                   24          0.077         0.0032083333
ispell-check-version                                       2           0.047         0.0235
ispell-call-process                                        2           0.047         0.0235
outline-show-heading                                       240         0.032         0.0001333333
outline-on-heading-p                                       5750        0.032         5.56...e-006
flyspell-word-search-forward                               2           0.032         0.016
custom-handle-keyword                                      2611        0.032         1.22...e-005
ispell-buffer-local-dict                                   98          0.032         0.0003265306
flyspell-check-spell-program                               50          0.03          0.0006
outline-flag-region                                        1375        0.016         1.16...e-005
flyspell-get-word                                          12          0.016         0.0013333333
color-theme-filter                                         3           0.016         0.0053333333
ispell-get-otherchars                                      12          0.016         0.0013333333
ispell-start-process                                       2           0.016         0.008
ispell-internal-change-dictionary                          98          0.016         0.0001632653
font-lock-default-fontify-buffer                           7           0.015         0.0021428571
font-lock-fontify-buffer                                   7           0.015         0.0021428571
flyspell-check-pre-word-p                                  10          0.015         0.0015
outline-invisible-p                                        98          0.0           0.0
outline-previous-heading                                   419         0.0           0.0
outline-up-heading                                         38          0.0           0.0
outline-end-of-heading                                     359         0.0           0.0
outline-mode                                               49          0.0           0.0
font-lock-prepend-text-property                            59          0.0           0.0
font-lock-update-removed-keyword-alist                     1           0.0           0.0
font-lock-mode-internal                                    101         0.0           0.0
font-lock-extend-region-wholelines                         26          0.0           0.0
font-lock-extend-jit-lock-region-after-change              12          0.0           0.0
font-lock-unfontify-buffer                                 2           0.0           0.0
font-lock-choose-keywords                                  51          0.0           0.0
font-lock-remove-keywords                                  225         0.0           0.0
font-lock-mode                                             208         0.0           0.0
font-lock-unfontify-region                                 26          0.0           0.0
font-lock-after-unfontify-buffer                           2           0.0           0.0
font-lock-default-function                                 208         0.0           0.0
font-lock-after-fontify-buffer                             7           0.0           0.0
font-lock-change-mode                                      51          0.0           0.0
font-lock-turn-off-thing-lock                              2           0.0           0.0
font-lock-extend-region-multiline                          26          0.0           0.0
font-lock-eval-keywords                                    102         0.0           0.0
font-lock-default-unfontify-buffer                         2           0.0           0.0
font-lock-compile-keyword                                  7464        0.0           0.0
font-lock-fontify-syntactically-region                     7           0.0           0.0
font-lock-default-unfontify-region                         26          0.0           0.0
font-lock-value-in-major-mode                              249         0.0           0.0
font-lock-turn-on-thing-lock                               99          0.0           0.0
flyspell-word-search-backward                              2           0.0           0.0
flyspell-hack-local-variables-hook                         48          0.0           0.0
flyspell-check-word-p                                      10          0.0           0.0
flyspell-delete-all-overlays                               1           0.0           0.0
flyspell-kill-ispell-hook                                  5           0.0           0.0
flyspell-highlight-duplicate-region                        1           0.0           0.0
flyspell-after-change-function                             12          0.0           0.0
flyspell-delay-commands                                    49          0.0           0.0
flyspell-pre-command-hook                                  10          0.0           0.0
flyspell-get-not-casechars                                 19          0.0           0.0
flyspell-prog-mode                                         1           0.0           0.0
flyspell-highlight-incorrect-region                        1           0.0           0.0
flyspell-mode-off                                          1           0.0           0.0
flyspell-deplacement-command                               196         0.0           0.0
flyspell-delay-command                                     294         0.0           0.0
flyspell-generic-progmode-verify                           8           0.0           0.0
flyspell-deplacement-commands                              49          0.0           0.0
flyspell-get-casechars                                     12          0.0           0.0
flyspell-delete-region-overlays                            38          0.0           0.0
flyspell-unhighlight-at                                    12          0.0           0.0
color-theme-frame-params                                   1           0.0           0.0
color-theme-alist                                          2           0.0           0.0
color-theme-spec-compat                                    448         0.0           0.0
color-theme-variables                                      1           0.0           0.0
color-theme-plist-delete                                   8           0.0           0.0
color-theme-install-frame-params                           1           0.0           0.0
color-theme-install-variables                              1           0.0           0.0
color-theme-faces                                          1           0.0           0.0
color-theme-alist-reduce                                   2           0.0           0.0
color-theme-spec-filter                                    1           0.0           0.0
color-theme-canonic                                        1           0.0           0.0
custom-handle-all-keywords                                 82          0.0           0.0
custom-add-link                                            136         0.0           0.0
custom-add-to-group                                        2183        0.0           0.0
custom-declare-group                                       200         0.0           0.0
custom-current-group                                       25          0.0           0.0
custom-add-version                                         237         0.0           0.0
custom-initialize-set                                      1           0.0           0.0
custom-set-default                                         2           0.0           0.0
custom-add-option                                          4           0.0           0.0
custom-add-dependencies                                    2           0.0           0.0
ispell-get-casechars                                       13          0.0           0.0
ispell-send-string                                         208         0.0           0.0
ispell-set-spellchecker-params                             59          0.0           0.0
ispell-process-status                                      98          0.0           0.0
ispell-check-minver                                        8           0.0           0.0
ispell-get-decoded-string                                  44          0.0           0.0
ispell-parse-output                                        7           0.0           0.0
ispell-get-ispell-args                                     2           0.0           0.0
ispell-get-extended-character-mode                         99          0.0           0.0
ispell-get-not-casechars                                   19          0.0           0.0
ispell-filter                                              9           0.0           0.0
ispell-get-many-otherchars-p                               12          0.0           0.0
ispell-get-coding-system                                   90          0.0           0.0
ispell-decode-string                                       43          0.0           0.0
ispell-kill-ispell                                         5           0.0           0.0
--8<---------------cut here---------------end--------------->8---

Any idea in which direction to go?

Environment:
  Org-mode version 7.5 (release_7.5.274.gd6aba.dirty)
  GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-10-14 on LENNART-69DE564 (patched)
  on Windows XP SP3

Best regards,
  Seb

-- 
Sébastien Vauban

[-- Attachment #2: tags-opening-it-is-sloooooooooow.org --]
[-- Type: text/x-org, Size: 2138 bytes --]

#+TITLE:     Tags FIXME
#+AUTHOR:    Seb Vauban
#+EMAIL:     no-LMehjL4SQ+Y@public.gmane.org
#+DATE:      2011-05-13
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en_US

#+STYLE:        <style type="text/css">a#current-tags { background: url('http://www.mygooglest.com/fni/pic/current.gif') no-repeat; background-position: 101% center; cursor: text;}</style>

This page is useless for you. It's only for me, for testing some code.

Ce texte est en français.
This is in English.

* Environments

The following are different environments, from the best to the less good...
The worse are not even shown ;-)

See http://orgmode.org/manual/Literal-examples.html#Literal-examples.

** Src with highlighting

   #+BEGIN_SRC sh
   #!/bin/sh
   #!/bin/sh 123456789 223456789 333456789 444456789 555556789 666666789 777777789 888888889 999999999 000000000 000000000
   # script -- What it does
   # Exits with zero if no error. Looooooonnnng comment... 0123 4567 8901 2345 6789 0123 abcd efgh ijkl mnop qrst uvwx yz01 2345 6789 0abc

   tempfile="/tmp/$(basename $0).tmp"

   # 80 chars exactly =============================================================

   trap "/bin/rm -f $tempfile" EXIT HUP INT QUIT TERM

   function usage()
   {
     cat << EOF >&2
   Usage: $(basename $0) flags...
   Where...
   EOF
     exit 1
   }

   if [ $# -eq 0 ]; then
     usage
   fi
   #+END_SRC

** Example

   #+BEGIN_EXAMPLE
   #!/bin/sh
   #!/bin/sh 123456789 223456789 333456789 444456789 555556789 666666789 777777789 888888889 999999999 000000000 000000000
   # script -- What it does
   # Exits with zero if no error. Looooooonnnng comment... 0123 4567 8901 2345 6789 0123 abcd efgh ijkl mnop qrst uvwx yz01 2345 6789 0abc

   tempfile="/tmp/$(basename $0).tmp"

   # 80 chars exactly =============================================================

   trap "/bin/rm -f $tempfile" EXIT HUP INT QUIT TERM

   function usage()
   {
     cat << EOF >&2
   Usage: $(basename $0) flags...
   Where...
   EOF
     exit 1
   }

   if [ $# -eq 0 ]; then
     usage
   fi
   #+END_EXAMPLE

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2011-05-12 22:27       ` Sebastien Vauban
@ 2011-05-13  9:49         ` Eric S Fraga
  2011-05-13 10:15         ` Carsten Dominik
  1 sibling, 0 replies; 13+ messages in thread
From: Eric S Fraga @ 2011-05-13  9:49 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:

> Hi Andrew, Vladimir, Nick, Achim, Carsten & al,
>
> Vladimir Alexiev wrote:
>> Sébastien Vauban <wxhgmqzgwmuf@...> writes:
>>> Believe me or not, but C-g has not effect during those 7 seconds. It simply
>>> does not stop anything
>>
>> Sounds like emacs is waiting inside some blocking call, and waits until it
>> times out. Likely a network call. Do you have any tramp/efs/angeftp stuff
>> going on?
>
> This has gotten worse. But, now, I have some proofs about what I experience:
> opening the attached Org file (2 KB) consumes me 191 seconds, yes 191 seconds,
> even when done after the agenda view has been launched -- I mean, all agenda
> files and all Org files have been read...

[...]

> Any idea in which direction to go?

What is the setting of org-src-fontify-natively?
Do the timings change if you set this to nil (if set to t now)?
I cannot remember if this has been discussed already so please ignore me
if I'm repeating something...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.274.gd6aba.dirty)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2011-05-12 22:27       ` Sebastien Vauban
  2011-05-13  9:49         ` Eric S Fraga
@ 2011-05-13 10:15         ` Carsten Dominik
  2011-05-18 20:09           ` Sebastien Vauban
  1 sibling, 1 reply; 13+ messages in thread
From: Carsten Dominik @ 2011-05-13 10:15 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode


On May 13, 2011, at 12:27 AM, Sebastien Vauban wrote:

> Hi Andrew, Vladimir, Nick, Achim, Carsten & al,
> 
> Vladimir Alexiev wrote:
>> Sébastien Vauban <wxhgmqzgwmuf@...> writes:
>>> Believe me or not, but C-g has not effect during those 7 seconds. It simply
>>> does not stop anything
>> 
>> Sounds like emacs is waiting inside some blocking call, and waits until it
>> times out. Likely a network call. Do you have any tramp/efs/angeftp stuff
>> going on?
> 
> This has gotten worse. But, now, I have some proofs about what I experience:
> opening the attached Org file (2 KB) consumes me 191 seconds, yes 191 seconds,
> even when done after the agenda view has been launched -- I mean, all agenda
> files and all Org files have been read..

I would think the only way to sort this out is the following:

1. Try loading the file with emacs -Q
2. Try loading it with 

    emacs -Q -l minimal.emacs

   where the minimal.emacs d does nothing but
   make sure that the latest Org is being loaded.

I expect that loading your file under these test will be very fast.


Then bisect your entire Emacs setup to find which part of your
setup is causing this issue.  I know you have *a lot* of setup,
but I don't see any other route.

- Carsten



> .
> 
> --8<---------------cut here---------------start------------->8---
> | find-file | start |c:/home/sva/Public/tags-opening-it-is-sloooooooooow.org | ___ |
> +-> Requiring `org-exp' (already loaded)
> OVERVIEW in c:/home/sva/Public/tags-opening-it-is-sloooooooooow.org
> Checking for library `filladapt'...
> +-> Requiring `filladapt' (already loaded)
> Checking for library `filladapt'... Found
> +-> Requiring `outline-mode-easy-bindings' (already loaded)
> +-> Requiring `bytecomp' (already loaded)
> Checking for library `filladapt'...
> +-> Requiring `filladapt' (already loaded)
> Checking for library `filladapt'... Found
> | find-file | stop | c:/home/sva/Public/tags-opening-it-is-sloooooooooow.org | 191.3 |
> --8<---------------cut here---------------end--------------->8---
> 
> Note that the variance is 0.1 second, over 3 Emacs restarts!  Pretty
> reproducible...
> 
> To obtain the above trace, I've added the following bits to my .emacs file:
> 
> #+begin_src emacs-lisp
>         ;; redefine require to leave a trace of packages being loaded
>         (if (not (fboundp 'orig-require))
>             (fset 'orig-require (symbol-function 'require))
>           (message "The code to redefine `require' should not be loaded twice"))
> 
>         (defvar my/require-depth 0)
> 
>         (defun require (feature &optional filename noerror)
>           "Leave a trace of packages being loaded."
>           (cond ((member feature features)
>                  (message "%sRequiring `%s' (already loaded)"
>                           (concat (make-string (* 2 my/require-depth) ? )
>                                   "+-> ")
>                           feature))
>                 (t
>                  (message "%sRequiring `%s'"
>                           (concat (make-string (* 2 my/require-depth) ? )
>                                   "+-> ")
>                           feature)
>                  (let ((my/require-depth (+ 1 my/require-depth)))
>                    (orig-require feature filename noerror))
>                  (message "%sRequiring `%s'...done"
>                           (concat (make-string (* 2 my/require-depth) ? )
>                                   "+-> ")
>                           feature))))
> 
>      (defvar missing-packages-list nil
>        "List of packages that `try-require' can't find.")
> 
>      ;; attempt to load a feature/library, failing silently
>      (defun try-require (feature)
>        "Attempt to load a library or module. Return true if the
>      library given as argument is successfully loaded. If not, instead
>      of an error, just add the package to a list of missing packages."
>        (condition-case err
>            ;; protected form
>            (progn
>              (message "Checking for library `%s'..." feature)
>              (if (stringp feature)
>                  (load-library feature)
>                (require feature))
>              (message "Checking for library `%s'... Found" feature))
>          ;; error handler
>          (file-error  ; condition
>           (progn
>             (message "Checking for library `%s'... Missing" feature)
>             (add-to-list 'missing-packages-list feature 'append))
>           nil)))
> 
> (defadvice find-file (around my-find-file activate)
>  "Open FILENAME and report time spent."
>  (let* ((my-filename (ad-get-arg 0))
>         (find-file-time-start (float-time)))
>    (message (concat "| find-file | start |" my-filename " | ___ |"))
>    ad-do-it
>    (message "| find-file | stop | %s | %.1f |"
>             my-filename
>             (- (float-time) find-file-time-start))))
> #+end_src
> 
> Trying to profile:
> 
> #+begin_src emacs-lisp
>  (elp-instrument-package "org")
>  (elp-instrument-package "outline")
>  (elp-instrument-package "font-lock")
>  (elp-instrument-package "flyspell")
>  (elp-instrument-package "bytecomp")
>  (elp-instrument-package "color-theme")
>  (elp-instrument-package "company")
>  (elp-instrument-package "custom")
>  (elp-instrument-package "files")
>  (elp-instrument-package "filladapt")
>  (elp-instrument-package "help-fns")
>  (elp-instrument-package "ispell")
>  (elp-instrument-package "outline-mode-easy-bindings"))
> #+end_src
> 
> did not help finding the culprit:
> 
> --8<---------------cut here---------------start------------->8---
> custom-declare-variable                                    1733        0.735         0.0004241200
> flyspell-mode                                              51          0.4210000000  0.0082549019
> flyspell-post-command-hook                                 10          0.3759999999  0.0375999999
> custom-initialize-default                                  33          0.375         0.0113636363
> flyspell-word                                              9           0.3609999999  0.0401111111
> outline-back-to-heading                                    5684        0.3430000000  6.03...e-005
> custom-initialize-reset                                    1699        0.3280000000  0.0001930547
> flyspell-mode-on                                           50          0.281         0.0056200000
> ispell-init-process                                        98          0.265         0.0027040816
> flyspell-accept-buffer-local-defs                          107         0.251         0.0023457943
> ispell-accept-buffer-local-defs                            98          0.251         0.0025612244
> outline-map-region                                         47          0.2200000000  0.0046808510
> custom-declare-face                                        133         0.2190000000  0.0016466165
> ispell-accept-output                                       2           0.2019999999  0.1009999999
> outline-next-heading                                       5095        0.1720000000  3.37...e-005
> font-lock-set-defaults                                     580         0.125         0.0002155172
> font-lock-add-keywords                                     226         0.125         0.0005530973
> font-lock-compile-keywords                                 180         0.125         0.0006944444
> ispell-buffer-local-words                                  98          0.125         0.0012755102
> ispell-buffer-local-parsing                                97          0.0939999999  0.0009690721
> color-theme-install-faces                                  1           0.0779999999  0.0779999999
> color-theme-install                                        1           0.0779999999  0.0779999999
> color-theme-leuven                                         1           0.0779999999  0.0779999999
> font-lock-default-fontify-region                           24          0.077         0.0032083333
> font-lock-fontify-keywords-region                          24          0.077         0.0032083333
> font-lock-fontify-region                                   24          0.077         0.0032083333
> ispell-check-version                                       2           0.047         0.0235
> ispell-call-process                                        2           0.047         0.0235
> outline-show-heading                                       240         0.032         0.0001333333
> outline-on-heading-p                                       5750        0.032         5.56...e-006
> flyspell-word-search-forward                               2           0.032         0.016
> custom-handle-keyword                                      2611        0.032         1.22...e-005
> ispell-buffer-local-dict                                   98          0.032         0.0003265306
> flyspell-check-spell-program                               50          0.03          0.0006
> outline-flag-region                                        1375        0.016         1.16...e-005
> flyspell-get-word                                          12          0.016         0.0013333333
> color-theme-filter                                         3           0.016         0.0053333333
> ispell-get-otherchars                                      12          0.016         0.0013333333
> ispell-start-process                                       2           0.016         0.008
> ispell-internal-change-dictionary                          98          0.016         0.0001632653
> font-lock-default-fontify-buffer                           7           0.015         0.0021428571
> font-lock-fontify-buffer                                   7           0.015         0.0021428571
> flyspell-check-pre-word-p                                  10          0.015         0.0015
> outline-invisible-p                                        98          0.0           0.0
> outline-previous-heading                                   419         0.0           0.0
> outline-up-heading                                         38          0.0           0.0
> outline-end-of-heading                                     359         0.0           0.0
> outline-mode                                               49          0.0           0.0
> font-lock-prepend-text-property                            59          0.0           0.0
> font-lock-update-removed-keyword-alist                     1           0.0           0.0
> font-lock-mode-internal                                    101         0.0           0.0
> font-lock-extend-region-wholelines                         26          0.0           0.0
> font-lock-extend-jit-lock-region-after-change              12          0.0           0.0
> font-lock-unfontify-buffer                                 2           0.0           0.0
> font-lock-choose-keywords                                  51          0.0           0.0
> font-lock-remove-keywords                                  225         0.0           0.0
> font-lock-mode                                             208         0.0           0.0
> font-lock-unfontify-region                                 26          0.0           0.0
> font-lock-after-unfontify-buffer                           2           0.0           0.0
> font-lock-default-function                                 208         0.0           0.0
> font-lock-after-fontify-buffer                             7           0.0           0.0
> font-lock-change-mode                                      51          0.0           0.0
> font-lock-turn-off-thing-lock                              2           0.0           0.0
> font-lock-extend-region-multiline                          26          0.0           0.0
> font-lock-eval-keywords                                    102         0.0           0.0
> font-lock-default-unfontify-buffer                         2           0.0           0.0
> font-lock-compile-keyword                                  7464        0.0           0.0
> font-lock-fontify-syntactically-region                     7           0.0           0.0
> font-lock-default-unfontify-region                         26          0.0           0.0
> font-lock-value-in-major-mode                              249         0.0           0.0
> font-lock-turn-on-thing-lock                               99          0.0           0.0
> flyspell-word-search-backward                              2           0.0           0.0
> flyspell-hack-local-variables-hook                         48          0.0           0.0
> flyspell-check-word-p                                      10          0.0           0.0
> flyspell-delete-all-overlays                               1           0.0           0.0
> flyspell-kill-ispell-hook                                  5           0.0           0.0
> flyspell-highlight-duplicate-region                        1           0.0           0.0
> flyspell-after-change-function                             12          0.0           0.0
> flyspell-delay-commands                                    49          0.0           0.0
> flyspell-pre-command-hook                                  10          0.0           0.0
> flyspell-get-not-casechars                                 19          0.0           0.0
> flyspell-prog-mode                                         1           0.0           0.0
> flyspell-highlight-incorrect-region                        1           0.0           0.0
> flyspell-mode-off                                          1           0.0           0.0
> flyspell-deplacement-command                               196         0.0           0.0
> flyspell-delay-command                                     294         0.0           0.0
> flyspell-generic-progmode-verify                           8           0.0           0.0
> flyspell-deplacement-commands                              49          0.0           0.0
> flyspell-get-casechars                                     12          0.0           0.0
> flyspell-delete-region-overlays                            38          0.0           0.0
> flyspell-unhighlight-at                                    12          0.0           0.0
> color-theme-frame-params                                   1           0.0           0.0
> color-theme-alist                                          2           0.0           0.0
> color-theme-spec-compat                                    448         0.0           0.0
> color-theme-variables                                      1           0.0           0.0
> color-theme-plist-delete                                   8           0.0           0.0
> color-theme-install-frame-params                           1           0.0           0.0
> color-theme-install-variables                              1           0.0           0.0
> color-theme-faces                                          1           0.0           0.0
> color-theme-alist-reduce                                   2           0.0           0.0
> color-theme-spec-filter                                    1           0.0           0.0
> color-theme-canonic                                        1           0.0           0.0
> custom-handle-all-keywords                                 82          0.0           0.0
> custom-add-link                                            136         0.0           0.0
> custom-add-to-group                                        2183        0.0           0.0
> custom-declare-group                                       200         0.0           0.0
> custom-current-group                                       25          0.0           0.0
> custom-add-version                                         237         0.0           0.0
> custom-initialize-set                                      1           0.0           0.0
> custom-set-default                                         2           0.0           0.0
> custom-add-option                                          4           0.0           0.0
> custom-add-dependencies                                    2           0.0           0.0
> ispell-get-casechars                                       13          0.0           0.0
> ispell-send-string                                         208         0.0           0.0
> ispell-set-spellchecker-params                             59          0.0           0.0
> ispell-process-status                                      98          0.0           0.0
> ispell-check-minver                                        8           0.0           0.0
> ispell-get-decoded-string                                  44          0.0           0.0
> ispell-parse-output                                        7           0.0           0.0
> ispell-get-ispell-args                                     2           0.0           0.0
> ispell-get-extended-character-mode                         99          0.0           0.0
> ispell-get-not-casechars                                   19          0.0           0.0
> ispell-filter                                              9           0.0           0.0
> ispell-get-many-otherchars-p                               12          0.0           0.0
> ispell-get-coding-system                                   90          0.0           0.0
> ispell-decode-string                                       43          0.0           0.0
> ispell-kill-ispell                                         5           0.0           0.0
> --8<---------------cut here---------------end--------------->8---
> 
> Any idea in which direction to go?
> 
> Environment:
>  Org-mode version 7.5 (release_7.5.274.gd6aba.dirty)
>  GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-10-14 on LENNART-69DE564 (patched)
>  on Windows XP SP3
> 
> Best regards,
>  Seb
> 
> -- 
> Sébastien Vauban
> <tags-opening-it-is-sloooooooooow.org>

- Carsten

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Huge performance problems to open some Org files
  2011-05-13 10:15         ` Carsten Dominik
@ 2011-05-18 20:09           ` Sebastien Vauban
  0 siblings, 0 replies; 13+ messages in thread
From: Sebastien Vauban @ 2011-05-18 20:09 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric, Carsten and al.,

Carsten Dominik wrote:
> On May 13, 2011, at 12:27 AM, Sebastien Vauban wrote:
>> Vladimir Alexiev wrote: This has gotten worse. But, now, I have some proofs
>> about what I experience: opening the attached Org file (2 KB) consumes me
>> 191 seconds, yes 191 seconds, even when done after the agenda view has been
>> launched -- I mean, all agenda files and all Org files have been read..
>
> I would think the only way to sort this out is the following:
>
> 1. Try loading the file with emacs -Q
> 2. Try loading it with
>
>     emacs -Q -l minimal.emacs
>
>    where the minimal.emacs d does nothing but
>    make sure that the latest Org is being loaded.
>
> I expect that loading your file under these test will be very fast.
>
> Then bisect your entire Emacs setup to find which part of your setup is
> causing this issue. I know you have *a lot* of setup, but I don't see any
> other route.

Found it!  Dunno understand the root cause yet, though.

After suspecting non-Org related stuff in my -- yes, Carsten -- huge .emacs
file, I found the problem to be here:

#+begin_src emacs-lisp
        (add-hook 'org-mode-hook
                  (lambda ()
                    ;; ;; display images in your Org files
                    ;; (turn-on-iimage-mode)
                    ;; PERFORMANCE PROBLEM with some Org files!!!

                    (local-set-key "\M-n" 'outline-next-visible-heading)
                    (local-set-key "\M-p" 'outline-previous-visible-heading)

                    ;; table
                    (local-set-key "\M-\C-w" 'org-table-copy-region)
                    (local-set-key "\M-\C-y" 'org-table-paste-rectangle)
                    (local-set-key "\M-\C-l" 'org-table-sort-lines)

                    ;; file modification date
                    (set (make-local-variable 'time-stamp-format) "%:y-%02m-%02d")
                    (set (make-local-variable 'time-stamp-start) "^#\\+DATE: +")
                    (set (make-local-variable 'time-stamp-end) "$")

                    ;; flyspell mode to spell check everywhere
                    (when (executable-find ispell-program-name)
                      ;; check if `ispell-program-name' seems correct
                      (flyspell-mode 1))
                    ))
#+end_src

Turning on the line iimage-mode makes opening of *some* Org files go from 0.2
seconds to 193 seconds!

The times are very stable on both sides.

Dunno yet why this happen (I have the impression only on _my_ Windows, not
when I was on Ubuntu), but this will be for some later day...

Best regards,
  Seb

-- 
Sébastien Vauban

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-05-18 20:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17  9:15 Huge performance problems to open some Org files Sébastien Vauban
2010-12-17 10:11 ` Rainer Stengele
2010-12-17 10:44   ` Sébastien Vauban
2010-12-17 12:17 ` Andrew J. Korty
2010-12-17 12:29 ` Carsten Dominik
2010-12-17 13:26   ` Sébastien Vauban
2010-12-20 19:29     ` Vladimir Alexiev
2011-05-12 22:27       ` Sebastien Vauban
2011-05-13  9:49         ` Eric S Fraga
2011-05-13 10:15         ` Carsten Dominik
2011-05-18 20:09           ` Sebastien Vauban
2010-12-17 15:46 ` Nick Dokos
2010-12-17 21:55 ` Achim Gratz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).