From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: ido slow for outline path completion Date: Sun, 21 Dec 2008 12:49:24 +0100 Message-ID: <0E2402E2-1B27-4E08-A78C-3727C5D37806@uva.nl> References: <20524da70812121204x9a23736g5a03f8a04d8213d5@mail.gmail.com> <67E6FD56-F95F-4EEB-8BC3-4ED566B2ECAB@uva.nl> <20524da70812181557m79252c30hc941fe5965f917e8@mail.gmail.com> <79368DAE-A865-485B-B0A3-E7952C80940B@uva.nl> <20524da70812191004t4d12921csf79c84ae0107efbf@mail.gmail.com> <20524da70812191432u332b9316p291ee9bba954a664@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: multipart/mixed; boundary="===============1178895469==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LEMoL-0001Jt-A8 for emacs-orgmode@gnu.org; Sun, 21 Dec 2008 06:49:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LEMoK-0001Il-KY for emacs-orgmode@gnu.org; Sun, 21 Dec 2008 06:49:28 -0500 Received: from [199.232.76.173] (port=44183 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEMoJ-0001Ie-RG for emacs-orgmode@gnu.org; Sun, 21 Dec 2008 06:49:27 -0500 Received: from ug-out-1314.google.com ([66.249.92.172]:32821) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LEMoJ-0003dk-7G for emacs-orgmode@gnu.org; Sun, 21 Dec 2008 06:49:27 -0500 Received: by ug-out-1314.google.com with SMTP id 36so792819uga.17 for ; Sun, 21 Dec 2008 03:49:26 -0800 (PST) In-Reply-To: <20524da70812191432u332b9316p291ee9bba954a664@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Samuel Wales Cc: emacs-orgmode@gnu.org --===============1178895469== Content-Type: multipart/alternative; boundary=Apple-Mail-3-297377612 --Apple-Mail-3-297377612 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Samuel, this is deep inside the ido routines, and I do not have enough insight to see what is going on. Maybe send a bug report to Kim? Maybe you can create a test case for him by capturing the table before it is passed to the ido-complete command? If it is really the length of the strings, a uniquify-like solution might be workable, but constructing the uniquify list may be slow as well..... I am putting this on my list, but not for the current year :-) - Carsten On Dec 19, 2008, at 11:32 PM, Samuel Wales wrote: > *** ido > Hi Carsten, > > Thanks for looking at the speed issues. > > This time an error showed up. The error from the messages > buffer is: > > Getting targets...done > eq: Wrong type argument: arrayp, (#("footodo/... > > The trigger is: > > org-goto, same settings as before, searching for a headline called > "parsing risk", > which does exist but never shows up as the main candidate. > I did load-file on ido.el and org.el for a better backtrace. > > I don't know the meanings of the different color patterns in > ido, and this might be a hint for speed, or this error, or both. > > p -- > shows an entry in body text face with a ^ with a red > background, rest of candidates are in red, fast. > pa -- same but with different entry > par -- same but with different entry > pars -- only one candidate shows and it is in green, fast > parsi -- > back to the first color pattern, different entry, slightly > slower > parsin -- same entry as parsi, slightly slower > parsing -- > same but with different entry, slower still (but only a > few seconds for me; maybe not noticeable on your computer) > parsing (space after g) -- > causes error, space not inserted, fast > > I append the backtrace. It isn't perfect. I deleted a > small number of lines that had the entire completion list in > them (the whole backtrace is 700k) and had to minorly > obfuscate a line for privacy, but did so in a consistent > way. > > ido-auto-merge-delay-time might or might not be relevant. I > have it set to the default of 0.7. > > Thanks. > > ===== > > The backtrace is: > > aref((#("footodo/mumble/issues/is froz bar foo something risking/" 0 > 6 (face org-level-1 org-category "todo-foo" fontified t) 6 7 nil 7 13 > (face org-level-1 org-category #("mumble" 0 6 ...) fontified t) 13 14 > nil 14 20 (face org-level-1 org-category #("mumble" 0 6 ...) fontified > t) 20 21 nil 21 64 (org-category #("mumble" 0 6 ...) fontified nil) 64 > 65 nil) "/Users/foo/Desktop/a/quux/todo-foo.org" > "^\\*\\*\\*\\*\\*\\*\\* TODO is froz bar foo something risking[ ]*$" > 17576) 3) > (eq (aref s l) 47) > (and (> l 0) (eq (aref s l) 47)) > (if (and (> l 0) (eq ... 47)) (substring s 0 l) s) > (let ((l ...)) (if (and ... ...) (substring s 0 l) s)) > ido-no-final-slash((#("... > (string-lessp (ido-no-final-slash a) (ido-no-final-slash b)) > ido-file-lessp((#("... > sort(((#("... > (let ((completion-list ...)) (if (featurep ...) (let ... ...) > (display-completion-list completion-list))) > (with-output-to-temp-buffer ido-completion-buffer (let (...) (if ... > ... ...))) > (if display-it (with-output-to-temp-buffer ido-completion-buffer > (let ... ...))) > (let ((temp-buf ...) display-it full-list) (if (and ... temp-buf) > (let ... ... ... ... ... ...) (setq display-it t)) (if display-it > (with-output-to-temp-buffer ido-completion-buffer ...))) > ido-completion-help() > call-interactively(ido-completion-help) > (if (and (not ...) (not ...)) (progn (setq ido-rescan ...) > (delete-region ... ...) (insert res)) (call-interactively (setq > this-command ido-cannot-complete-command))) > (cond (ido-incomplete-regexp) ((and ... ...) (let ... ...)) > (ido-directory-too-big (setq ido-directory-too-big nil) (setq > ido-text-init ido-text) (setq ido-exit ...) (exit-minibuffer)) ((not > ido-matches) (when ido-completion-buffer ...)) ((and ... ... ...) (if > ... ... ... ... ...)) (t (setq res ido-common-match-string) (if ... > ... ...))) > (let (res) (cond (ido-incomplete-regexp) (... ...) > (ido-directory-too-big ... ... ... ...) (... ...) (... ...) (t ... > ...))) > ido-complete() > (if (and (stringp ido-common-match-string) (stringp ido-text) (cond > ... ... ...)) (insert " ") (ido-complete)) > ido-complete-space() > call-interactively(ido-complete-space) > completing-read("Goto: " (("dummy" . 1)) nil nil nil org-refile- > history) > (catch (quote ido) (completing-read (ido-make-prompt item prompt) > (quote ...) nil nil (prog1 ido-text-init ...) history)) > (setq ido-final-text (catch (quote ido) (completing-read ... ... nil > nil ... history))) > (let ((minibuffer-local-completion-map ...) > (minibuffer-local-filename-completion-map ...) (max-mini-window-height > ...) (ido-completing-read t) (ido-require-match require-match) > (ido-use-mycompletion-depth ...) (show-paren-mode nil)) (setq ido-exit > nil) (setq ido-final-text (catch ... ...))) > (while (not done) (ido-trace " > _LOOP_" ido-text-init) (setq ido-exit nil) (setq ido-rescan t) (setq > ido-rotate nil) (setq ido-text "") (when ido-set-default-item (setq > ido-default-item ...) (if ... ...) (ido-trace "new default" > ido-default-item) (if ido-default-item ...) (setq ido-set-default-item > nil)) (if ido-process-ignore-lists-inhibit (setq > ido-process-ignore-lists nil)) (if (and ido-use-merged-list ... ...) > (let ... ... ...)) (cond (ido-keep-item-list ...) (... ...) (... ...) > (... ...) (... ...) (t nil)) (setq ido-rotate-temp nil) (if > ido-process-ignore-lists-inhibit (setq ido-process-ignore-lists t > ido-process-ignore-lists-inhibit nil)) (ido-set-matches) (if (and > ido-matches ...) (setq ido-try-merged-list t)) (let (... ... ... ... > ... ... ...) (setq ido-exit nil) (setq ido-final-text ...)) (ido-trace > "completing-read" ido-final-text) (if (get-buffer > ido-completion-buffer) (kill-buffer ido-completion-buffer)) (ido-trace > " > _EXIT_" ido-exit) (cond (... ... nil) (... ...) (... ... nil) (... > ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ...) (t ... > ...))) > (let ((ido-cur-item item) (ido-entry-buffer ...) > (ido-process-ignore-lists t) (ido-process-ignore-lists-inhibit nil) > (ido-set-default-item t) ido-default-item ido-selected ido-final-text > (done nil) (icomplete-mode nil) ido-cur-list ido-ignored-list > (ido-rotate-temp nil) (ido-keep-item-list nil) (ido-use-merged-list > nil) (ido-try-merged-list t) (ido-pre-merge-state nil) (ido-case-fold > ido-case-fold) (ido-enable-prefix ido-enable-prefix) > (ido-enable-regexp ido-enable-regexp)) (ido-setup-completion-map) > (setq ido-text-init initial) (setq ido-input-stack nil) (run-hooks > (quote ido-setup-hook)) (while (not done) (ido-trace " > _LOOP_" ido-text-init) (setq ido-exit nil) (setq ido-rescan t) (setq > ido-rotate nil) (setq ido-text "") (when ido-set-default-item ... ... > ... ... ...) (if ido-process-ignore-lists-inhibit ...) (if ... ...) > (cond ... ... ... ... ... ...) (setq ido-rotate-temp nil) (if > ido-process-ignore-lists-inhibit ...) (ido-set-matches) (if ... ...) > (let ... ... ...) (ido-trace "completing-read" ido-final-text) (if ... > ...) (ido-trace " > _EXIT_" ido-exit) (cond ... ... ... ... ... ... ... ... ... ...)) > ido-selected) > ido-read-internal(list "Goto: " org-refile-history nil t nil) > (let ((ido-current-directory nil) (ido-directory-nonreadable nil) > (ido-directory-too-big nil) (ido-context-switch-command ...) > (ido-choice-list choices)) (ido-read-internal (quote list) prompt hist > def require-match initial-input)) > > ... > > (if (and org-completion-use-ido (fboundp ...) (boundp ...) ido-mode > (listp ...)) (apply (quote ido-completing-read) (concat ...) (cdr > args)) (apply (quote completing-read) args)) > > ... > > (let* ((cbuf ...) (cfunc ...) (extra ...) (filename ...) (tbl ...) > (completion-ignore-case t)) (assoc (funcall cfunc prompt tbl nil t nil > ...) tbl)) > org-refile-get-location("Goto: ") > (nth 3 (org-refile-get-location "Goto: ")) > (if (eq interface (quote outline)) (car (org-get-location ... > org-goto-help)) (nth 3 (org-refile-get-location "Goto: "))) > (let* ((org-refile-targets ...) (org-refile-use-outline-path t) > (interface ...) (org-goto-start-pos ...) (selected-point ...)) (if > selected-point (progn ... ... ...) (message "Quit"))) > org-goto(nil) > call-interactively(org-goto) --Apple-Mail-3-297377612 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi = Samuel,

this is deep inside the ido routines, and I = do not have enough
insight to see what is going on. =  Maybe send a bug report to Kim?
Maybe you can create a = test case for him by capturing the table
before it is passed = to the ido-complete command?


If = it is really the length of the strings, a uniquify-like = solution
might be workable, but constructing the uniquify list = may
be slow as well.....
I am putting this on my = list, but not for the current year :-)

- = Carsten

On Dec 19, 2008, at 11:32 PM, Samuel = Wales wrote:

*** ido
Hi Carsten,

Thanks for looking at = the speed issues.

This time an error showed up.  The error = from the messages
buffer is:

 Getting targets...done
=  eq: Wrong type argument: arrayp, (#("footodo/...

The = trigger is:

org-goto, same settings as before, searching for a = headline called
"parsing risk",
which does exist but never shows = up as the main candidate.
I did load-file on ido.el and org.el for a = better backtrace.

I don't know the meanings of the different = color patterns in
ido, and this might be a hint for speed, or this = error, or both.

p --
 shows an entry in body text face = with a ^ with a red
 background, rest of candidates are in red, = fast.
pa -- same but with different entry
par -- same but with = different entry
pars -- only one candidate shows and it is in green, = fast
parsi --
 back to the first color pattern, different = entry, slightly
 slower
parsin -- same entry as parsi, = slightly slower
parsing --
 same but with different entry, = slower still (but only a
 few seconds for me; maybe not = noticeable on your computer)
parsing  (space after g) --
=  causes error, space not inserted, fast

I append the = backtrace.  It isn't perfect.  I deleted a
small number of = lines that had the entire completion list in
them (the whole = backtrace is 700k) and had to minorly
obfuscate a line for privacy, = but did so in a consistent
way.

ido-auto-merge-delay-time = might or might not be relevant.  I
have it set to the default of = 0.7.

Thanks.

=3D=3D=3D=3D=3D

The backtrace = is:

 aref((#("footodo/mumble/issues/is froz bar foo = something risking/" 0
6 (face org-level-1 org-category "todo-foo" = fontified t) 6 7 nil 7 13
(face org-level-1 org-category #("mumble" 0 = 6 ...) fontified t) 13 14
nil 14 20 (face org-level-1 org-category = #("mumble" 0 6 ...) fontified
t) 20 21 nil 21 64 (org-category = #("mumble" 0 6 ...) fontified nil) 64
65 nil) = "/Users/foo/Desktop/a/quux/todo-foo.org"
"^\\*\\*\\*\\*\\*\\*\\* TODO = is froz bar foo something risking[ ]*$"
17576) 3)
 (eq = (aref s l) 47)
 (and (> l 0) (eq (aref s l) 47))
 (if = (and (> l 0) (eq ... 47)) (substring s 0 l) s)
 (let ((l ...)) = (if (and ... ...) (substring s 0 l) s))
=  ido-no-final-slash((#("...
 (string-lessp = (ido-no-final-slash a) (ido-no-final-slash b))
=  ido-file-lessp((#("...
 sort(((#("...
 (let = ((completion-list ...)) (if (featurep ...) (let ... = ...)
(display-completion-list completion-list)))
=  (with-output-to-temp-buffer ido-completion-buffer (let (...) (if = ...
... ...)))
 (if display-it (with-output-to-temp-buffer = ido-completion-buffer
(let ... ...)))
 (let ((temp-buf ...) = display-it full-list) (if (and ... temp-buf)
(let ... ... ... ... ... = ...) (setq display-it t)) (if display-it
(with-output-to-temp-buffer = ido-completion-buffer ...)))
 ido-completion-help()
=  call-interactively(ido-completion-help)
 (if (and (not = ...) (not ...)) (progn (setq ido-rescan ...)
(delete-region ... ...) = (insert res)) (call-interactively (setq
this-command = ido-cannot-complete-command)))
 (cond (ido-incomplete-regexp) = ((and ... ...) (let ... ...))
(ido-directory-too-big (setq = ido-directory-too-big nil) (setq
ido-text-init ido-text) (setq = ido-exit ...) (exit-minibuffer)) ((not
ido-matches) (when = ido-completion-buffer ...)) ((and ... ... ...) (if
... ... ... ... = ...)) (t (setq res ido-common-match-string) (if ...
... ...)))
=  (let (res) (cond (ido-incomplete-regexp) (... = ...)
(ido-directory-too-big ... ... ... ...) (... ...) (... ...) (t = ...
...)))
 ido-complete()
 (if (and (stringp = ido-common-match-string) (stringp ido-text) (cond
... ... ...)) = (insert " ") (ido-complete))
 ido-complete-space()
=  call-interactively(ido-complete-space)
=  completing-read("Goto: " (("dummy" . 1)) nil nil nil = org-refile-history)
 (catch (quote ido) (completing-read = (ido-make-prompt item prompt)
(quote ...) nil nil (prog1 = ido-text-init ...) history))
 (setq ido-final-text (catch = (quote ido) (completing-read ... ... nil
nil ... history)))
=  (let ((minibuffer-local-completion-map = ...)
(minibuffer-local-filename-completion-map ...) = (max-mini-window-height
...) (ido-completing-read t) = (ido-require-match require-match)
(ido-use-mycompletion-depth ...) = (show-paren-mode nil)) (setq ido-exit
nil) (setq ido-final-text = (catch ... ...)))
 (while (not done) (ido-trace "
_LOOP_" = ido-text-init) (setq ido-exit nil) (setq ido-rescan t) = (setq
ido-rotate nil) (setq ido-text "") (when ido-set-default-item = (setq
ido-default-item ...) (if ... ...) (ido-trace "new = default"
ido-default-item) (if ido-default-item ...) (setq = ido-set-default-item
nil)) (if ido-process-ignore-lists-inhibit = (setq
ido-process-ignore-lists nil)) (if (and ido-use-merged-list ... = ...)
(let ... ... ...)) (cond (ido-keep-item-list ...) (... ...) (... = ...)
(... ...) (... ...) (t nil)) (setq ido-rotate-temp nil) = (if
ido-process-ignore-lists-inhibit (setq ido-process-ignore-lists = t
ido-process-ignore-lists-inhibit nil)) (ido-set-matches) (if = (and
ido-matches ...) (setq ido-try-merged-list t)) (let (... ... ... = ...
... ... ...) (setq ido-exit nil) (setq ido-final-text ...)) = (ido-trace
"completing-read" ido-final-text) (if = (get-buffer
ido-completion-buffer) (kill-buffer = ido-completion-buffer)) (ido-trace
"
_EXIT_" ido-exit) (cond (... = ... nil) (... ...) (... ... nil) (...
...) (... ...) (... ...) (... = ... ...) (... ... ...) (... ...) (t ...
...)))
 (let = ((ido-cur-item item) (ido-entry-buffer ...)
(ido-process-ignore-lists = t) (ido-process-ignore-lists-inhibit nil)
(ido-set-default-item t) = ido-default-item ido-selected ido-final-text
(done nil) = (icomplete-mode nil) ido-cur-list ido-ignored-list
(ido-rotate-temp = nil) (ido-keep-item-list nil) (ido-use-merged-list
nil) = (ido-try-merged-list t) (ido-pre-merge-state nil) = (ido-case-fold
ido-case-fold) (ido-enable-prefix = ido-enable-prefix)
(ido-enable-regexp ido-enable-regexp)) = (ido-setup-completion-map)
(setq ido-text-init initial) (setq = ido-input-stack nil) (run-hooks
(quote ido-setup-hook)) (while (not = done) (ido-trace "
_LOOP_" ido-text-init) (setq ido-exit nil) (setq = ido-rescan t) (setq
ido-rotate nil) (setq ido-text "") (when = ido-set-default-item ... ...
... ... ...) (if = ido-process-ignore-lists-inhibit ...) (if ... ...)
(cond ... ... ... = ... ... ...) (setq ido-rotate-temp nil) = (if
ido-process-ignore-lists-inhibit ...) (ido-set-matches) (if ... = ...)
(let ... ... ...) (ido-trace "completing-read" ido-final-text) = (if ...
...) (ido-trace "
_EXIT_" ido-exit) (cond ... ... ... ... = ... ... ... ... ... ...)) ido-selected)
 ido-read-internal(list = "Goto: " org-refile-history nil t nil)
 (let = ((ido-current-directory nil) (ido-directory-nonreadable = nil)
(ido-directory-too-big nil) (ido-context-switch-command = ...)
(ido-choice-list choices)) (ido-read-internal (quote list) = prompt hist
def require-match initial-input))

...

=  (if (and org-completion-use-ido (fboundp ...) (boundp ...) = ido-mode
(listp ...)) (apply (quote ido-completing-read) (concat ...) = (cdr
args)) (apply (quote completing-read) args))

...

=  (let* ((cbuf ...) (cfunc ...) (extra ...) (filename ...) (tbl = ...)
(completion-ignore-case t)) (assoc (funcall cfunc prompt tbl nil = t nil
...) tbl))
 org-refile-get-location("Goto: ")
=  (nth 3 (org-refile-get-location "Goto: "))
 (if (eq = interface (quote outline)) (car (org-get-location ...
org-goto-help)) = (nth 3 (org-refile-get-location "Goto: ")))
 (let* = ((org-refile-targets ...) (org-refile-use-outline-path t)
(interface = ...) (org-goto-start-pos ...) (selected-point ...)) = (if
selected-point (progn ... ... ...) (message "Quit")))
=  org-goto(nil)
=  call-interactively(org-goto)

<= /body>= --Apple-Mail-3-297377612-- --===============1178895469== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1178895469==--