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

Long lag on first invocation of Easymotion commands #136

Closed
jatcwang opened this Issue Apr 1, 2014 · 16 comments

Comments

Projects
None yet
3 participants
@jatcwang

jatcwang commented Apr 1, 2014

Hello,

I've noticed that since updating (I last updated 4 months ago), that the first invocation of any easymotion function is slow. When I start a fresh gVim instance, open a file and invoke any easymotion command, gVim will freeze for around 10 seconds.

Is this expected due to Vim's autoload mechanism and new features? Since I did not notice this in previous version of Easymotion.

Environment:
gVim 7.4
Windows 8
Easymotion v2.0

Cheers :)

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Apr 2, 2014

Member

Hi, @jtcwang. Thanks for your report.

Is this expected due to Vim's autoload mechanism and new features? Since I did not notice this in previous version of Easymotion.

Hmmm, maybe. Previous version didn't use autoload directory correctly, and loaded all files at startup, and I fixed it to use correctly and in addition, I added new features, and new autoload files...

gVim will freeze for around 10 seconds.

But, 10 seconds is too long, it's definitely more than expected... :(

Questions

Is it really occurred with any easymotion command? I especially improve find motions(e.g. <Plug>(easymotion-s), default <Leader><Leader>s), and it actually need to load more autoload files than other motions like <Plug>(easymotion-w)(default <Leader><Leader>w). Would you mind trying <Leader><Leader>w again?

the first invocation of any easymotion function is slow

If it's true, in other words, it's fast from the second times, it's considered to be highly probable that autoload files is the problems.

I can't reproduce it in my environment, but I'll look into it.

Member

haya14busa commented Apr 2, 2014

Hi, @jtcwang. Thanks for your report.

Is this expected due to Vim's autoload mechanism and new features? Since I did not notice this in previous version of Easymotion.

Hmmm, maybe. Previous version didn't use autoload directory correctly, and loaded all files at startup, and I fixed it to use correctly and in addition, I added new features, and new autoload files...

gVim will freeze for around 10 seconds.

But, 10 seconds is too long, it's definitely more than expected... :(

Questions

Is it really occurred with any easymotion command? I especially improve find motions(e.g. <Plug>(easymotion-s), default <Leader><Leader>s), and it actually need to load more autoload files than other motions like <Plug>(easymotion-w)(default <Leader><Leader>w). Would you mind trying <Leader><Leader>w again?

the first invocation of any easymotion function is slow

If it's true, in other words, it's fast from the second times, it's considered to be highly probable that autoload files is the problems.

I can't reproduce it in my environment, but I'll look into it.

@jatcwang

This comment has been minimized.

Show comment
Hide comment
@jatcwang

jatcwang Apr 3, 2014

I tested on another computer, and the lag is significantly shorter (~1s), so it is most likely just a machine-specific lag.

I also did some test, easymotion-s has different lag period than easymotion-w.

Anyway, I think this is a non-issue and I'll live with it.

Thanks for your work. This is one of my favourite plugins.

jatcwang commented Apr 3, 2014

I tested on another computer, and the lag is significantly shorter (~1s), so it is most likely just a machine-specific lag.

I also did some test, easymotion-s has different lag period than easymotion-w.

Anyway, I think this is a non-issue and I'll live with it.

Thanks for your work. This is one of my favourite plugins.

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Apr 3, 2014

Member

Thanks for the test.

It's tradeoff, but if you want, please try this branch and add a following lines to your vimrc.

https://github.com/Lokaltog/vim-easymotion/tree/preload

" Preload autload files
call EasyMotion#preload()

Of cource, startup times of vim itself may become longer, but this method will avoid the first-time-lag problem.

Or you can use autocmd, such as FocusLost, to call this function.

Member

haya14busa commented Apr 3, 2014

Thanks for the test.

It's tradeoff, but if you want, please try this branch and add a following lines to your vimrc.

https://github.com/Lokaltog/vim-easymotion/tree/preload

" Preload autload files
call EasyMotion#preload()

Of cource, startup times of vim itself may become longer, but this method will avoid the first-time-lag problem.

Or you can use autocmd, such as FocusLost, to call this function.

@jatcwang

This comment has been minimized.

Show comment
Hide comment
@jatcwang

jatcwang May 16, 2014

Hi @haya14busa,

I have decided to revisit this issue. Has the preload branch been merged into the master branch? I can't seem to find the function in the latest update.

Cheers

jatcwang commented May 16, 2014

Hi @haya14busa,

I have decided to revisit this issue. Has the preload branch been merged into the master branch? I can't seem to find the function in the latest update.

Cheers

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa May 23, 2014

Member

No, I haven't merge preload feature into master because I don't know the preload function solves the issue. I can't reproduce long lag in the first place...
Would you mind trying this branch https://github.com/Lokaltog/vim-easymotion/tree/preload and give me the result.

Member

haya14busa commented May 23, 2014

No, I haven't merge preload feature into master because I don't know the preload function solves the issue. I can't reproduce long lag in the first place...
Would you mind trying this branch https://github.com/Lokaltog/vim-easymotion/tree/preload and give me the result.

@haya14busa haya14busa added the Improve label Jun 12, 2014

@haya14busa haya14busa changed the title from Long lag on first invocation of Easymotion commands (gVim) to Long lag on first invocation of Easymotion commands May 2, 2015

@timfeirg

This comment has been minimized.

Show comment
Hide comment
@timfeirg

timfeirg Jun 29, 2015

I've had something similar, I'm on cfcafd7 and easymotion freezes when invoked, had to kill process to get out, while branch preload doesn't have this problem.

FYI for me this only happens when I'm working on some large code (800+ lines).

update

oh, I didn't put those lines in my .vimrc, so I wouldn't know if the preload feature call EasyMotion#preload() solves my problem

timfeirg commented Jun 29, 2015

I've had something similar, I'm on cfcafd7 and easymotion freezes when invoked, had to kill process to get out, while branch preload doesn't have this problem.

FYI for me this only happens when I'm working on some large code (800+ lines).

update

oh, I didn't put those lines in my .vimrc, so I wouldn't know if the preload feature call EasyMotion#preload() solves my problem

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Jun 29, 2015

Member

I just updated preload branch.
Could you please updating branch and trying it again?

Member

haya14busa commented Jun 29, 2015

I just updated preload branch.
Could you please updating branch and trying it again?

@timfeirg

This comment has been minimized.

Show comment
Hide comment
@timfeirg

timfeirg Jun 29, 2015

thanks for the quick response.

  • I tried 62b1008 on branch preload, and I tried with and without the following line in my vimrc:
" Preload autload files
call EasyMotion#preload()

vim freezes completely on invoking easymotion.

update

I rolled back a couple of commits to discover commit ef0cb2b (a week ago) won't freeze vim.

timfeirg commented Jun 29, 2015

thanks for the quick response.

  • I tried 62b1008 on branch preload, and I tried with and without the following line in my vimrc:
" Preload autload files
call EasyMotion#preload()

vim freezes completely on invoking easymotion.

update

I rolled back a couple of commits to discover commit ef0cb2b (a week ago) won't freeze vim.

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Jun 29, 2015

Member

I rolled back a couple of commits to discover commit ef0cb2b (a week ago) won't freeze vim.

So, is the bad commit b686168 which is the commit after ef0cb2b?
If b686168 is not the bad commit, could you please trying git bisect to detect the bad commit?

I suspect that b11864a is the bad commit bad I cannot reproduce this.

Member

haya14busa commented Jun 29, 2015

I rolled back a couple of commits to discover commit ef0cb2b (a week ago) won't freeze vim.

So, is the bad commit b686168 which is the commit after ef0cb2b?
If b686168 is not the bad commit, could you please trying git bisect to detect the bad commit?

I suspect that b11864a is the bad commit bad I cannot reproduce this.

@timfeirg

This comment has been minimized.

Show comment
Hide comment
@timfeirg

timfeirg Jun 29, 2015

I'm quite confirmed that b686168 was the bad commit

timfeirg commented Jun 29, 2015

I'm quite confirmed that b686168 was the bad commit

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Jun 29, 2015

Member

FYI for me this only happens when I'm working on some large code (800+ lines).

  1. Please give me a example large code.
  2. Please tell me the Vim version
  3. Please tell me what mappings do you use? <Plug>(easymotion-s) or something.
  4. Does freeze means freeze Vim completely or just it take too long time?
  5. If you have some knowledge about Vim script, could you please debugging the code?
Member

haya14busa commented Jun 29, 2015

FYI for me this only happens when I'm working on some large code (800+ lines).

  1. Please give me a example large code.
  2. Please tell me the Vim version
  3. Please tell me what mappings do you use? <Plug>(easymotion-s) or something.
  4. Does freeze means freeze Vim completely or just it take too long time?
  5. If you have some knowledge about Vim script, could you please debugging the code?
@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Jul 1, 2015

Member

@timfeirg
There are actually bugs in easymotion and solved it right now. ref: #235
I guess the problem is the same, so could you please updating easymotion and cheking it?

Member

haya14busa commented Jul 1, 2015

@timfeirg
There are actually bugs in easymotion and solved it right now. ref: #235
I guess the problem is the same, so could you please updating easymotion and cheking it?

@timfeirg

This comment has been minimized.

Show comment
Hide comment
@timfeirg

timfeirg Jul 1, 2015

I was having trouble determining what kind of file will cause the freeze, so it's the folds.
I'm on 2a2cf14 and this problem is gone.
thank you with all my heart, can I buy you guys coffee at bountysource or something?

timfeirg commented Jul 1, 2015

I was having trouble determining what kind of file will cause the freeze, so it's the folds.
I'm on 2a2cf14 and this problem is gone.
thank you with all my heart, can I buy you guys coffee at bountysource or something?

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Jul 4, 2015

Member

thank you with all my heart, can I buy you guys coffee at bountysource or something?

Thank you very much but I don't use bountysource nor gratipay.
The problem was caused by just my mistake so it's happy enough for me to hear your kindness :)

Member

haya14busa commented Jul 4, 2015

thank you with all my heart, can I buy you guys coffee at bountysource or something?

Thank you very much but I don't use bountysource nor gratipay.
The problem was caused by just my mistake so it's happy enough for me to hear your kindness :)

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Mar 22, 2016

Member

I improved first loading time #282. Can you update the plugin and try it again?

Member

haya14busa commented Mar 22, 2016

I improved first loading time #282. Can you update the plugin and try it again?

@haya14busa

This comment has been minimized.

Show comment
Hide comment
@haya14busa

haya14busa Dec 25, 2016

Member

must be fixed

Member

haya14busa commented Dec 25, 2016

must be fixed

@haya14busa haya14busa closed this Dec 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment