unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Leo Liu <sdl.web@gmail.com>
Cc: 11906@debbugs.gnu.org
Subject: bug#11906: 24.1; completion-at-point failures
Date: Fri, 10 May 2013 16:36:05 -0400	[thread overview]
Message-ID: <jwvvc6q38j7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m18v3n9w6m.fsf@gmail.com> (Leo Liu's message of "Fri, 10 May 2013 14:38:09 +0800")

>>> completion-at-point also invokes those functions in order to decide when
>>> to exit. This causes problems illustrated at the beginning of this
>>> report and, for example, I have also experienced delay in inserting
>>> space, dot, etc following a completion.
>> Can you explain how "this causes problems"?  What makes you think
>> it's related?
> OK, I just hit another performance issue with this repetitive invoking
> of completion functions by completion-at-point. To see this issue:

> 1. emacs -q (choose an emacs that doesn't have the fix in revision 112539)
> 2. M-x run-octave
> 3. Type 'uint <TAB>'
> 4. Type 'history 10'

I don't understand this recipe: where should I type "history 10"?  right
there after the "uint" text?

> You should see:

>  1040 completion_matches ("uint");

>  1041 completion_matches ("uint");

>  1042 completion_matches ("uint");

>  1043 history 5

Where should I see it?

<fiddling around some more>

Ah, OK.
so I should type RET before "history 10", so history shows me the last
commands run by octave.

> So basically computation for the matches against 'uint' has been done
> three times.

Fine, yes.  There can be various reasons why the completion table is run
several times.  In the present case, 2 is the minimum: once to try and
complete "uint" (which just returns "uint") and once to get the
completion candidates.  Why there's a third call?  I couldn't tell you
off the top of my head.  Maybe it's an inefficiency somewhere.

> Now when the computation is expensive (such as against the
> empty string "") one should observe a terrible delay.

The difference between 2 and 3 calls shouldn't be sufficiently large to
go from "acceptable" to "terrible delay".

> I have to work around this issue in octave by revision 112539.

Using a cache is a good idea: when there's no completion, the completion
code may call the completion-table many more times than just 3 times
(typically, it will call it at least once per completion-style).


        Stefan





  reply	other threads:[~2013-05-10 20:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11  5:54 bug#11906: 24.1; completion-at-point failures Leo
2012-07-12 14:00 ` Stefan Monnier
2013-05-10  6:38   ` Leo Liu
2013-05-10 20:36     ` Stefan Monnier [this message]
2013-05-11  1:50       ` Leo Liu
2013-05-11  3:40         ` Stefan Monnier
2013-05-11  4:47           ` Leo Liu
2013-05-11 14:51             ` Stefan Monnier
2013-05-13  1:28               ` Leo Liu
2013-05-13 15:27                 ` Stefan Monnier
2013-05-14  0:56                   ` Leo Liu
2013-05-14  2:53                     ` Stefan Monnier
2013-05-14  3:30                       ` Leo Liu
2013-05-11 20:18             ` Andreas Röhler
2013-05-11 23:11           ` Daimrod
2013-05-13 15:28             ` Stefan Monnier
2013-05-21 23:39           ` Dmitry Gutov
2013-05-22 19:16             ` Stefan Monnier
2013-12-05  3:23               ` Dmitry Gutov
2013-12-05  4:33                 ` Stefan Monnier
2013-12-06  1:02                   ` Dmitry Gutov
2013-12-06  4:00                     ` Leo Liu
2013-12-06  4:32                       ` Dmitry Gutov
2013-12-06  5:36                         ` Leo Liu
2013-12-06 13:15                           ` Dmitry Gutov
2013-12-06 14:04                             ` Leo Liu
2013-12-06 17:35                               ` Stefan Monnier
2013-12-07  2:05                                 ` Leo Liu
2013-12-07 22:45                                   ` Stefan Monnier
2013-12-06 17:36                               ` Stefan Monnier
2013-12-07  2:02                               ` Dmitry Gutov
2013-12-07  2:40                                 ` Leo Liu
2013-12-07 16:13                                   ` Dmitry Gutov
2013-12-09  2:27                                     ` Leo Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvvc6q38j7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=11906@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).