VIM hangs at 100% CPU for 10 seconds

Bug #1242298 reported by Thanassis Tsiodras
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Expired
Undecided
Unassigned

Bug Description

After defining a rather lengthy typescript snippet (attached in the bug report), I noticed the following behavior:

$ vim a.ts
direc<tab>
<then cursor down 15-20 times, so selection area is grown, and in the end, type 'v'>

VIM will stay stuck at 100% CPU for 10 seconds.
'u'ndoing will also take another 10 seconds.

The ultisnips commit I am currently at:
0b8c95645ff1b6d5db
(I used pathogen to add it to my bundles)

:py import sys; print sys.version:
2.7.5 (default, Sep 6 2013, 09:59:46)
[GCC 4.8.1 20130725 (prerelease)]

Tags: stuck vim
Revision history for this message
Thanassis Tsiodras (ttsiodras) wrote :
Revision history for this message
Thanassis Tsiodras (ttsiodras) wrote :

I case it is relevant: I am also using the typescript plugin (https://github.com/leafgarland/typescript-vim.git) and am doing all this under Arch Linux, with vim version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 3 2013 20:01:21)
Included patches: 1-16
Compiled by Arch Linux
Huge version with GTK2 GUI.

Revision history for this message
SirVer (sirver) wrote :

The problem you see is with big snippets. UltiSnips takes track of changes to the buffer by diff'ing it to the previous version and guessing what kind of modifications the user might have done. The diffing algorithm is O(n^3) and is run on any cursor move - this can become quite expensive. Unfortunately, I know of no other reliable way to get the set of changes out of Vim - there is no way to access the undo history for example, and it would probably also not be enough.

Changed in ultisnips:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for UltiSnips because there has been no activity for 60 days.]

Changed in ultisnips:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.