Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete very slows, keeps setting the mark #16

Closed
brabalan opened this issue Feb 21, 2013 · 13 comments
Closed

autocomplete very slows, keeps setting the mark #16

brabalan opened this issue Feb 21, 2013 · 13 comments

Comments

@brabalan
Copy link

When I try to autocomplete, it takes several seconds between the moment I choose a completion and the moment it is inserted. During that time, the minibuffer keeps flashing with messages. Here is what they are:

point: 373 start! 373
Mark set [2 times]
point: 387 start! 373
Mark set [2 times]
point: 396 start! 396
Mark set [2 times]
point: 395 start! 395
Mark set [2 times]
point: 394 start! 394
Mark set [2 times]
point: 393 start! 393
Mark set [2 times]
point: 392 start! 392
Mark set [2 times]
point: 391 start! 391
Mark set [2 times]
point: 390 start! 390
Mark set [2 times]
point: 389 start! 389
Mark set [2 times]
point: 388 start! 388
Mark set [4 times]

I'm using the opam installed version of Merlin.

@trefis
Copy link
Contributor

trefis commented Feb 21, 2013

I'm guessing you're using emacs?

@ghost ghost assigned asmanur Feb 21, 2013
@brabalan
Copy link
Author

Oops, yes, sorry.

@asmanur
Copy link
Contributor

asmanur commented Feb 21, 2013

Could you be a little more specific ? I have a little delay when trying to complete after "Batteries.", is this kind of completion you are talking about, or it is slow even when there is few matches ?

@brabalan
Copy link
Author

It happens even with very few choices. For instance, typing "str", I immediately have 5 choices, but it's when I select the choice that the delay happens.

I also see some delay when I'm using "backspace" on such lines, or when I edit the "locked" zone. I suspect merlin keeps trying to compile what I write, and this interacts badly with completion. I don't know how to tell merlin to stop trying to find the types of things, to see if this is the culprit.

If it matters, I'm on OS X, with a Cocoa emacs 24.2.1, built with homebrew. I installed merlin yesterday with opam.

@asmanur
Copy link
Contributor

asmanur commented Feb 22, 2013

It happens even with very few choices. For instance, typing "str", I immediately have 5 choices, but it's when I select the choice that the delay happens.

I also see some delay when I'm using "backspace" on such lines, or when I edit the "locked" zone. I suspect merlin keeps trying to compile what I write, and this interacts badly with completion. I don't know how to tell merlin to stop trying to find the types of things, to see if this is the culprit.

If it matters, I'm on OS X, with a Cocoa emacs 24.2.1, built with homebrew. I installed merlin yesterday with opam.


Reply to this email directly or view it on GitHub:
#16 (comment)

You could try (setq merlin-idle-delay 0.). By the way are you up to
date with master, completion has been slightly changed yesterday.

@let-def
Copy link
Contributor

let-def commented Feb 22, 2013

Ok, I tried Merlin with vim and aquamacs on a Mac OS X Mountain Lion.

Vim integration with Merlin was completely transparent, going like a breeze.
Aquamacs was almost unusable, with severe slowdown during completion or idle-typing.

This seem related to OcamlPro/typerex#2 .

@let-def let-def closed this as completed Feb 22, 2013
@let-def let-def reopened this Feb 22, 2013
@brabalan
Copy link
Author

You could try (setq merlin-idle-delay 0.).

I did, but it did not change anything.

By the way are you up to
date with master, completion has been slightly changed yesterday.

I use the opam version. Does it directly come from git, or is it a released version? Is there a way to update to master using opam?

@asmanur
Copy link
Contributor

asmanur commented Feb 22, 2013

You could try (setq merlin-idle-delay 0.).

I did, but it did not change anything.

By the way are you up to
date with master, completion has been slightly changed yesterday.

I use the opam version. Does it directly come from git, or is it a released version? Is there a way to update to master using opam?

opam install merlin should do.

@brabalan
Copy link
Author

I updated the version and it's even slower.

@brabalan
Copy link
Author

OK, so it seems that the issue is that merlin tries to find the type as it does the completion. What would be helpful is a way to avoid merlin to automatically find the types (so I would need to manually do a C-c C-ret to make the locked zone grow).

@asmanur
Copy link
Contributor

asmanur commented Feb 24, 2013

Alan Schmitt notifications@github.com writes:

OK, so it seems that the issue is that merlin tries to find the type as it does the completion. What would be helpful is a way to avoid merlin to automatically find the types (so I would need to manually do a C-c C-ret to make the locked zone grow).

Thanks for the report. I disabled the idle checking during completion
(or at least I believe I have). Could you try again ? Besides I disabled
the synchronization during automatic completion so that no other merlin
commands are run during completion. If you want to synchronize the
buffer and complete, you can now use the new shortcut C-c TAB (which
overrides tuareg).

@brabalan
Copy link
Author

It seems to be much better. I'll keep stressing it and will reopen if I notice something wrong. Thanks a lot!

@brabalan
Copy link
Author

brabalan commented Mar 5, 2013

I tried another version of emacs for OS X, and merlin is much faster on it (as well as flyspell, which used to be very slow as well). So this may be another way to solve this.

Here it is: https://github.com/railwaycat/emacs-mac-port

catern pushed a commit to catern/merlin that referenced this issue May 6, 2024
Signed-off-by: Roman Leshchinskiy <rleshchinskiy@janestreet.com>
Co-authored-by: Roman Leshchinskiy <rleshchinskiy@janestreet.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants