-
Notifications
You must be signed in to change notification settings - Fork 161
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
profile auto-completion #44
Comments
Interesting ... patch just with -p3 cleanly applies and doesn't break any tests ... https://travis-ci.org/mcepl/rope/builds/15833656 |
In general, I think supporting case insensitive completions is a good The main known performance issue in rope, besides the automatic Static My comments follow:
Constructing File and Folder objects seems rather cheap; does
I am worried that the overhead of searching the previous return
The main problem with saving the return value of this function is that
This does not seem necessary and adding the decorator for
Actually self.pymodule does the caching itself; it uses _ConcludedData So I think it is important to find out if ImportedModule._get_module()
This makes me worried for two reasons:
Supporting case insensitive completions seems interesting...
I suggest calling startswith() and tolower().startswith() directly
|
By @JulianEberius
The main changes I made to Rope concern auto-completion. It is very, very slow on large code bases (just try Rope’s completions on Rope’s code itself). I used Python’s profile module to track where the time is spent on a single completion request, and it was mainly file system related stuff that is called a lot of times for a single request. I added a lot of caching to my branch of Rope, but I didn’t fully check whether I introduced subtle bugs or changed semantics this way. It improved latency by several orders of magnitude, which was important as Sublime Text does „as-you-type“ autocompletion, so the operation needs to be performed in milliseconds (on almost every keystroke) even on large code bases.
Please see my commit on SublimePythonIDE for details, if you’re interested on tackling this problem (JulianEberius/SublimePythonIDE@85c490cd64). Sadly the commit intermingles the caching with a second, minor, issue: case-insensitive completions. Some people prefer to just type, and not to worry about lower/upper case if the completion engine can return the right thing anyway. As I said, this is minor, compared to the performance issues.
To tackle the problems systematically, it’s probably best if you to some profiling of your own, I just used cProfile and gprof2dot to make graphs… If the completion performance is improved I would love to just add Rope as a submodule, instead of maintaining my own fork.
The text was updated successfully, but these errors were encountered: