Home Download Buy Blog Forum Support

Goto Anything... is very slow

Goto Anything... is very slow

Postby Xikeon on Mon May 27, 2013 8:02 am

Hi all,

My "Goto Anything..." used to be blazing fast, but all of a sudden it changed (a few months ago already...). It was perfect for a long time and then all of a sudden the next day it was slow as hell.

Video: http://www.screenr.com/rT8H
(typing louder so you can see how long it takes compared to me typing).

And this is still "fast" considering how slow it gets during the day now.

I tried reinstalling and using it without plugins, but it's still slow. I tried using ST3 with no plugins, also no luck..
Also coworkers with the same project don't have this issue, so I don't think it's project size related.. And as it worked fine for months that also proves it really.

Anyone else have this issue? Is it known? Can I help debug?

My machine is an iMac 2.9 GHz i5, 8GB memory.

Regards.
Xikeon
 
Posts: 18
Joined: Fri Feb 26, 2010 5:30 pm

Re: Goto Anything... is very slow

Postby Eduan on Tue May 28, 2013 8:26 pm

Have you tried restarting your Mac? I know this is a common tip for Windows, but I have seen it work with my Mac as well. :)
Check out my blog and website: EduanTech.com (currently undergoing some facial and organs makeover...)
Also check out my profiles: GitHub - Greduan | BitBucket - Greduan
Eduan
 
Posts: 140
Joined: Sun Oct 14, 2012 4:05 pm

Re: Goto Anything... is very slow

Postby gaberankin on Mon Jun 03, 2013 2:46 pm

I am actually having the same problem, although it started for me just last week. Unsure what could have changed between when it was working quickly and when it started running slowly, and suggestions on determining a cause or a fix would be appreciated.

The moment I noticed it start for me, I figured that maybe there was something going on behind the scenes of my mac and restarted. However, this didn't seem to help anything, and I'm not really certain what other information I could supply to help troubleshoot the issue.

[EDIT] Also, i should point out that I'm using Sublime Text 2. the original poster said they were using ST3.
gaberankin
 
Posts: 1
Joined: Mon Jun 03, 2013 1:26 pm

Re: Goto Anything... is very slow

Postby DryRun on Tue Jun 04, 2013 9:35 pm

I'd like to add another voice to the problem. I'm working within a rather large project (a few hundred files), and the Goto Anything dialogue is very slow. In particular, I have a number of files (around 20) that start with the same phrase, "FakeFactor...", and after typing in "Fake", each successive letter I type takes ~1-4 seconds to appear on screen.

I'll also note that I don't experience the problem on my Ubuntu desktop, only on my Mac laptop; whether it's the operating system or the available system resources, I have no idea. Regardless, though, I think at least the rendering of text on-screen needs to be detached from the search process itself, so that the dialogue doesn't become useless when the search bogs down.
DryRun
 
Posts: 1
Joined: Tue Jun 04, 2013 9:28 pm

Re: Goto Anything... is very slow

Postby garukun on Tue Jul 02, 2013 3:32 pm

+1 to the same problem, I have removed every plugin on sublime text 3 BUILD 3047, and it's still performing really slowly.
garukun
 
Posts: 2
Joined: Tue Jul 02, 2013 3:31 pm

Re: Goto Anything... is very slow

Postby DaleCurtis on Tue Jul 09, 2013 11:08 pm

I've been having a similar problem on my Linux machine with ST3 3047, so I decided to attach strace and see what was going on. You can do this yourself by running "sudo strace -p -T <sublime_text_process> -o sublime.trace" and then trying to use goto anything a couple times. That'll record the time for each system call in seconds and append it in <> to the end of each log line.

In my case it looks like the close() operation on the inotify_add_watch() is taking half a second or more in many cases -- and it's being called nearly every other keystroke.

Here's the trace output for one of the directories in my project: http://pastebin.com/kgAh51pP -- Note the close() time here:
close(128) = 0 <0.502742>

I'm not sure why close() is taking half a second. The drive is an SSD and the project contains ~140k source files (Chrome). In any case, it'd be nice if SublimeText could defer close() operations to a non-UI thread to avoid this sort of blocking.
DaleCurtis
 
Posts: 3
Joined: Tue Jul 09, 2013 10:58 pm

Re: Goto Anything... is very slow

Postby jps on Wed Jul 10, 2013 3:06 am

Thanks for the investigation Dale. I'll put a change in the next build to reduce the number of inotify_add_watch()...close() calls during Goto Anything, which will hopefully be enough to address the issue.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Goto Anything... is very slow

Postby DaleCurtis on Wed Jul 10, 2013 6:38 pm

Awesome. Thanks for your great work!

I'm following up with some kernel folk on why close() is taking so long. I'll update here for posterity's sake if that results in an upstream bug anywhere. The speculation points to the read-copy-update (RCU) mechanism used by inotify and its required grace period. Additionally, the issue appears "fixed" in 3.3+ kernels, though the close() is still not all that fast (~36ms).

$ uname -a
Linux ... 3.2.5 ... x86_64 GNU/Linux

$ strace -T ./inotify
...
inotify_init() = 3 <0.000112>
close(3) = 0 <0.529482>

$ uname -a
Linux ... 3.3.8 ... x86_64 GNU/Linux

$ strace -T ./inotify
...
inotify_init() = 4 <0.000146>
close(4) = 0 <0.036985>
DaleCurtis
 
Posts: 3
Joined: Tue Jul 09, 2013 10:58 pm

Re: Goto Anything... is very slow

Postby garukun on Thu Jul 11, 2013 3:03 pm

It seems that uninstalling sublime and reinstalling it back fixes the issue. It leads me to think if it has anything to do with the caches that were stored for every time goto anything opens up the dialog. I didn't dig further since for now it seems to work good enough for me, but hopefully this information helps.

Looking forward to the next build.

PS. I'm also on Ubuntu 12.04 LTS, and sublime 3047 BUILD.
garukun
 
Posts: 2
Joined: Tue Jul 02, 2013 3:31 pm

Re: Goto Anything... is very slow

Postby Xikeon on Wed Jul 24, 2013 9:30 am

I'm sorry for not responding anymore, I have been on holiday.

Is there any news on this? Have changes been made? If so I'd like to hear if it worked and if it is ST3 only (seeing as I'm still using ST2).

Thanks!

Edit:
To give some information on comments the rest gave:
Restarting: This doesn't help, I guess it's quite obvious when I say I have had the issues for a couple of months now.
Reinstalling: Also didn't help me, also have the issue on both ST2 and ST3.
Xikeon
 
Posts: 18
Joined: Fri Feb 26, 2010 5:30 pm

Next

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 23 guests