jimenezrick/vimerl

A long time exiting Vim when using vimerl

dkuhlman opened this issue · 13 comments

Thanks much for vimerl.

A problem -- When I exit Vim while editing an Erlang (.erl) file, it
takes a long time to exit back to the command line (several
minutes).

I'm using vimerl from Github: http://github.com/jimenezrick/vimerl.
I did a "git pull" just this morning.

I'm on Ubuntu GNU/Linux 12.10.

When I type erl at the command line, I see:

$ erl
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:3:3]
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.1  (abort with ^G)

I've compiled Erlang from otp_src_R16B.tar.gz. Possibly the problem
is with the new version of Erlang/otp?

Another possible clue -- Using "top", which is a processor monitor
that runs on Linux, I see that while vim is editing an erlang file, there is
a process beam.smp that is taking up lots of CPU time (almost 100%
on one core). That can't be good.

I tried "falling back" to vimerl-1.4.1 from
http://www.vim.org/scripts/script.php?script_id=3743, but the
problem is still there. So, I'd definitely say that one thing to
suspect is the R16B version of Erlang.

Note that when I remove vimerl and merely use the erlang support
that comes with Vim, the problem is not there.

I'm running Vim compiled from the Mercurial repository at
https://vim.googlecode.com/hg/.

Thanks for any help.

Dave

Yes, if you see a beam process using all the CPU, then the problem is in the indenter script for sure.

I have a similar problem. When I enter from normal mode to edit mode, vim hangs for a long time. This only appears after I updated to R16B. And yes, beam.smp consumes 60-100% CPU during that hang.

Confirmed @bullno1, same with R16B. Something's wrong with indenting script/fifos - could not figure it out.

So, this bug is also related to the compiler bug in R16?

Possibly.
See https://gist.github.com/aerosol/5142287

Commenting the -mode(compile) out makes beam processes die quicker, but still slowly.

Earlier today, I built Erlang from source from Github (https://github.com/erlang/otp.git). All seems well with vimerl now.

Oops. I might have fooled myself about the new erlang build fixing this. I'd also done a "git pull" in my vimerl repository. But, it does seem to be working. Perhaps something was fixed in vimerl?

A fix was added to mitigate the problem. Look at the last commit.

Any update on using Vimerl with R16?

evnu commented

R16B01 isn't released yet. I also didn't find any commit on OTP fixing the bug. It's probably best to wait for R16B01 and ask the maintainers again if it still doesn't work.

R16B01 is out with this fix:

 compiler-4.9.2
 OTP-10939  Compiling functions with complex boolean operations in guards
        could be very slow. (Thanks to Magnus Muller for reporting
        this issue.)

Could someone confirm if this fix resolves the issue? In order to do this, just revert c304838.

evnu commented

Works here.

Commit reverted, everything should work fine with R16B01, if not just reopen this issue.