Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

YAML performance fixes #921

Merged
merged 9 commits into from
Nov 26, 2018
Merged

YAML performance fixes #921

merged 9 commits into from
Nov 26, 2018

Conversation

citizenmatt
Copy link
Member

@citizenmatt citizenmatt commented Nov 23, 2018

Addresses major performance issues with large numbers of large YAML files.

Memory usage:

  • Use text buffers instead of allocating strings for each node in the PSI tree
  • Use chameleon nodes to skip creating PSI sub-trees for documents that don't need to be examined

Solution load performance:

  • Don't walk entire PSI tree looking for references in UnityEvent handler cache

Find usages performance:

  • Don't walk entire PSI tree looking for references in standard YAML reference searcher

@citizenmatt citizenmatt added this to the Rider 2018.3 milestone Nov 23, 2018
@citizenmatt citizenmatt self-assigned this Nov 23, 2018
@SugoiDev
Copy link

Could you consider adding #914 as part of this change?

@citizenmatt
Copy link
Member Author

Short answer is no. I’ll reply over there with a longer answer when I’m not on my phone :)

@citizenmatt
Copy link
Member Author

And it’s not as bad as it sounds!

@SugoiDev
Copy link

No problem, take your time!

I.e. the syntax tree isn't fully realised until it's requested
There are no YAML specific declared elements, so it's better handled in consumers, e.g. Unity support, which can search for known C# declared elements (methods, classes, etc.)
If the GUID isn't a known word in text, the chameleon might not be opened
If the node being skipped is the last sibling, we never reset to enumerate descendants, and skip a huge chunk of the file. This needs to be fixed in the SDK
@citizenmatt citizenmatt changed the title [WIP] YAML performance fixes YAML performance fixes Nov 25, 2018
@@ -23,6 +25,19 @@ public IFile ParseFile()
}
}

public INode ParseRootBlockNode()
{
using (var lifetimeDefinition = Lifetimes.Define())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Lifetimes.Using

@citizenmatt citizenmatt merged commit 6b0161c into 183 Nov 26, 2018
@citizenmatt citizenmatt deleted the feature/yaml-performance branch November 26, 2018 15:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants