Skip to content

Commit

Permalink
Performance improvements
Browse files Browse the repository at this point in the history
NNKit commit 6107640b7d051bb34431dcf01030815537937266 significantly
reduces dogpiling on the part of the window content polling objects,
but the real change here is moving `[self.store
startUpdatingWindowContents]` to run after the interface has been set
to display—the rendering thread takes long enough when the views its
rendering are not changing, updating the contents of the most expensive
layers before any have been drawn to the screen creates a feedback
loop: the renderer is delayed, having to catch up on more updates,
which gives the polling objects more time to queue more updates.

Unfortunately #30 is still a problem, but this improves things
significantly.
  • Loading branch information
numist committed Oct 17, 2013
1 parent 233046b commit dc364d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Frameworks/NNKit
Submodule NNKit updated 1 files
+9 −10 NNKit/Actors/NNPollingObject.m
4 changes: 2 additions & 2 deletions Switch/NNCoreWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
NSString const *NNCoreWindowControllerActiveKey = @"NNCoreWindowControllerActiveKey";


static NSTimeInterval kNNWindowDisplayDelay = 0.15;
static NSTimeInterval kNNWindowDisplayDelay = 0.1;


@interface NNCoreWindowController () <NNWindowStoreDelegate, NNHUDCollectionViewDataSource, NNHUDCollectionViewDelegate>
Expand Down Expand Up @@ -154,6 +154,7 @@ - (void)setUpReactions;
if ([shouldDisplayInterface boolValue]) {
[self.window setFrame:[NSScreen mainScreen].frame display:YES];
[self.window orderFront:self];
[self.store startUpdatingWindowContents];
NNLog(@"Showed interface (%.3fs elapsed)", [[NSDate date] timeIntervalSinceDate:self.invocationTime]);
} else {
NNLog(@"Hiding interface (%.3fs elapsed)", [[NSDate date] timeIntervalSinceDate:self.invocationTime]);
Expand Down Expand Up @@ -363,7 +364,6 @@ - (void)store:(NNWindowStore *)store didChangeWindow:(NNWindow *)window atIndex:
- (void)storeDidChangeContent:(NNWindowStore *)store;
{
if (!self.windowListLoaded) {
[self.store startUpdatingWindowContents];
NNLog(@"Window list loaded with %lu windows (%.3fs elapsed)", (unsigned long)self.windows.count, [[NSDate date] timeIntervalSinceDate:self.invocationTime]);
self.windowListLoaded = YES;
}
Expand Down

0 comments on commit dc364d9

Please sign in to comment.