-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Debounce calls to ProjectManager._renderTree. #10120
Conversation
This is a possible fix for #9851. In my tests, this can cause a dramatic speed up when lots of filesystem changes cause the tree to be continuously rerendered. I chose 100ms as the debounce time because that seemed quick enough that users will not be waiting for their actions to be reflected in the tree.
|
The following WorkingSetView Integration test is failing: "should show the file in project tree when a file is being renamed" Error: Expected undefined to be 'file_two.js'.
at new jasmine.ExpectationResult (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:114:32)
at null.toBe (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:1235:29)
at null.<anonymous> (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/spec/WorkingSetView-test.js:268:70)
at jasmine.Block.execute (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:1064:17)
at jasmine.Queue.next_ (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:2096:31)
at jasmine.Queue.start (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:2049:8)
at jasmine.Spec.execute (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:2376:14)
at jasmine.Queue.next_ (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:2096:31)
at onComplete (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:2092:18)
at jasmine.Spec.finish (file://localhost/Users/randyedmunds/github/brackets-shell/xcodebuild/Release/Brackets.app/Contents/dev/test/thirdparty/jasmine-core/jasmine.js:2350:5) |
|
@dangoor Done with review. I verified Brackets is now much more responsive with massive changes to file tree (which I tested using git). Just need to fix 1 unit test. |
|
Test fixed. Ready for re-review. |
test/spec/SpecRunnerUtils.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already a Jasmine waits(timeout) function. Does that not work here?
|
Done with review. I don't think we need new function and there's a Travis JSHint error. |
Also fixes JSHint error.
|
Ugh, my email is coming through delayed by a few hours right now. I didn't realize Jasmine had |
|
Merging. |
Debounce calls to ProjectManager._renderTree.
This is a possible fix for #9851. In my tests, this can cause a
dramatic speed up when lots of filesystem changes cause the tree
to be continuously rerendered.
I chose 100ms as the debounce time because that seemed quick enough that
users will not be waiting for their actions to be reflected in the tree.