Improve IronPython2 code completion performance#15731
Improve IronPython2 code completion performance#15731mjkkirschner merged 2 commits intoDynamoDS:masterfrom
Conversation
|
I'm interested to understand what is actually slow here - it's not clear to me what the difference would be between ironpython2 and 3 - okay, so ironPython2 uses the ironPython based completion core: but ironPython3 just falls back to the DSCPython based one... I have no idea if it actually works though, it's just a fallback - so comparing their performance is not really appropriate. I think likely this PR avoids eagerly doing whatever super slow stuff we have in the legacy IronPythonCodeCompletionProvider though so it seems okay to me. |
UI Smoke TestsTest: success. 11 passed, 0 failed. |
|
test failure: but I have no idea what is real or flaky, even if things seems unrelated - that's not really acceptable to merge if a PR causes a failure. |
Purpose
Getting the
__doc__docstrings in the IronPython2 can be very slow (15-100ms) for each call. Every time you press.on a large namespace or type, Dynamo (and possibly its host) freezes. Whenever you use theAutodesk.Revit.DB.namespace for example, Revit freezes for multiple seconds, making editing iron python 2 scripts a horrible experience.Luckily the experience is much better in IronPython3 and getting the docstrings is much faster.
Unfortunately, it CPython getting the docstrings has not been implemented yet.
This PR also implements lazy loading of the in the overarching class and delays the execution until the description is actually displayed and needed.
User Experience
This is what a user experiences currently (felt like 10 seconds to me):

And here's the now instantaneous experience with the proposed changes:

Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Use N/A to indicate that the changes in this pull request do not apply to Release Notes. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
@bendikberg, @mjkkirschner