Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

switch project performance improvements #1197

Merged
merged 5 commits into from
Jul 10, 2012
Merged

Conversation

redmunds
Copy link
Contributor

Changes:

  • Do not check disk for file existence when opening files for a project, just add them to the working set. Handle case where a working set file no longer exists.
  • Fix ChangedDocumentTracker so it doesn't read each file from disk as they are added to working set. Start/stop tracking documents when created/deleted.
  • Handle adding/removing multiple working set files at a time to minimize how many times re-layout is done for working set and project tree once (i.e. not for each file). Note that re-layout is triggered when calculating whether to draw shadow, selection rectangle, and selection triangle.
  • Also implement these improvements for multiple file open

@ghost ghost assigned gruehle Jul 9, 2012

$(DocumentManager).on("beforeDocumentDelete", function (event, doc) {
// Only documents in the current project are tracked
if (ProjectManager.isWithinProject(doc.file.fullPath)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for a document to remain loaded, even after its project has been closed? If so, this check will fail and the listener won't be removed. It should be safe to just unconditionally remove the listener.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't think of how that could happen, but I made the change to be safe.

I also fixed a few other JSLint warnings in this file.

@gruehle
Copy link
Member

gruehle commented Jul 9, 2012

Initial review complete.

@redmunds
Copy link
Contributor Author

Finished with updates for initial code review.

@gruehle
Copy link
Member

gruehle commented Jul 10, 2012

Looks good, and definitely speeds up project loading! Merging.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants