Allow RCTDisplayLink to pause more often

Summary:
By default we run the the JS display link, even if there are no modules listening. Given that most listeners will be lazily constructed, let's make it paused by default.

Since RCTTiming almost never unpauses due to some long-lived timers, implement a sleep timer that pauses the displaylink but uses an NSTimer to wake up in time.

Reviewed By: mhorowitz

Differential Revision: D3235044

fbshipit-source-id: 4a340fea552ada1bd8bc0d83b596a7df6f992387
This commit is contained in:
Pieter De Baets
2016-07-11 08:25:43 -07:00
committed by Facebook Github Bot 4
parent 4840233bcd
commit 7b718b03eb
3 changed files with 126 additions and 36 deletions

View File

@@ -426,7 +426,7 @@ SEL RCTParseMethodSignature(NSString *methodSignature, NSArray<RCTMethodArgument
- (NSDictionary *)profileArgs
{
if (_profileArgs) {
if (!_profileArgs) {
// This sets _selector
[self processMethodSignature];
_profileArgs = @{