Skip to content
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

Added caching for referenced file sets #944

Merged
merged 4 commits into from Nov 5, 2019
Merged

Added caching for referenced file sets #944

merged 4 commits into from Nov 5, 2019

Conversation

HannahSchellekens
Copy link
Member

I added a caching mechanism for the infamous, relatively expensive findReferencedFileSet function. The quick (1-2 min) tests I've conducted result in approximately 0.6 times a many file set calls: before 95 ms between each call on average, and after 169 ms time between each call on average.

Where the old mechanism keeps on calling the function a lot when you type, the new mechanism will signifiacntly lessen the amount of calls over time.

I have not yet tested this on larger scaled documents.

Additions

  • Added ReferencedFileSetCache that handles the cache for file sets.
  • Added the project service ReferencedFileSetService (and impl) that act as accessor for the file set cache.

Changes

  • Made the extension PsiFile.referencedFileSet use the said file set service.
  • The cache gets rebuild on LatexCommandsImpl.subtreeChanged().

All usage was already delegated to the PsiFile.referencedFileSet
extension method, so changing that method to use the ReferencedFileSetService
was enough for it to take effect.
@HannahSchellekens HannahSchellekens added the enhancement New feature or (non bug related) change to the program. label Jul 2, 2019
@HannahSchellekens HannahSchellekens added this to the b0.6.7 milestone Jul 2, 2019
@HannahSchellekens HannahSchellekens self-assigned this Jul 2, 2019
Copy link
Collaborator

@PHPirates PHPirates left a comment

Choose a reason for hiding this comment

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

Nice, good job on working on actually important issues :)
I didn't test it, but it doesn't seem to break anything critical.

@PHPirates PHPirates merged commit 341e341 into master Nov 5, 2019
@PHPirates PHPirates deleted the file-set-cache branch November 5, 2019 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants