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

Performance is not amazing on Retina machines. #30

Open
numist opened this issue Jul 22, 2013 · 2 comments
Open

Performance is not amazing on Retina machines. #30

numist opened this issue Jul 22, 2013 · 2 comments
Labels
Milestone

Comments

@numist
Copy link
Owner

numist commented Jul 22, 2013

Which makes sense—there are at least 4x as many pixels—but also sucks because the window content updating code path is already pretty well-optimised (Just check out the metrics in imageComparators.h!).

Maybe #14 will help?

@numist
Copy link
Owner Author

numist commented Oct 17, 2013

2013-10-16 21:41:49.696 Switch[46331:303] NNCoreWindowController.m:410 Invoked (0s elapsed)
2013-10-16 21:41:49.697 Switch[46331:303] NNCoreWindowController.m:191 Switch is active (0.00100s elapsed)
2013-10-16 21:41:49.723 Switch[46331:303] NNCoreWindowController.m:367 Window list loaded with 12 windows (0.02662s elapsed)
2013-10-16 21:41:51.463 Switch[46331:303] NNCoreWindowController.m:391 Display timer fired 1.61681s late (1.76681s elapsed)
2013-10-16 21:41:51.466 Switch[46331:303] NNCoreWindowController.m:176 Adjusted index to select first window (1.77046s elapsed)
2013-10-16 21:41:51.472 Switch[46331:303] NNCoreWindowController.m:155 Showing interface (1.77598s elapsed)
2013-10-16 21:41:51.476 Switch[46331:303] NNCoreWindowController.m:158 Showed interface (1.77949s elapsed)

Between window list load and the display timer firing, the window content workers run 32 iterations, but there really only needs to be 12.

Instruments has more bad news, from a different run:

screen shot 2013-10-16 at 9 45 41 pm

numist added a commit that referenced this issue Oct 17, 2013
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.
@numist
Copy link
Owner Author

numist commented Oct 17, 2013

I've improved things significantly with dc364d9, but the user experience still isn't snappy enough. Sure, -orderFront: is returning right away, but the window isn't actually being drawn on screen until an annoyingly long time after.

2013-10-16 22:28:08.584 Switch[48424:303] NNCoreWindowController.m:414 Invoked (0s elapsed)
2013-10-16 22:28:08.585 Switch[48424:303] NNCoreWindowController.m:195 Switch is active (0.001s elapsed)
2013-10-16 22:28:08.592 Switch[48424:303] NNCoreWindowController.m:371 Window list loaded with 12 windows (0.008s elapsed)
2013-10-16 22:28:08.754 Switch[48424:303] NNCoreWindowController.m:395 Display timer fired 0.020s late (0.170s elapsed)
2013-10-16 22:28:08.754 Switch[48424:303] NNCoreWindowController.m:183 Index does not need adjustment (0.171s elapsed)
2013-10-16 22:28:08.755 Switch[48424:303] NNCoreWindowController.m:156 Showing interface (0.172s elapsed)
2013-10-16 22:28:08.757 Switch[48424:303] NNCoreWindowController.m:162 Showed interface (0.173s elapsed)

Unfortunately none of the NSWindowDelegate methods provide accurate timing for when the window is actually displayed on screen, so there isn't a great way to instrument this yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant