Skip to content

Commit 6af0029

Browse files
authored
Ignore iOS prewarming (oblador#97)
1 parent 75b9a8c commit 6af0029

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

examples/vanilla/ios/Podfile.lock

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,12 +934,21 @@ PODS:
934934
- react-native-flipper (0.182.0):
935935
- React-Core
936936
- react-native-performance (4.0.0):
937-
- RCT-Folly
937+
- hermes-engine
938+
- RCT-Folly (= 2021.07.22.00)
938939
- RCTRequired
939940
- RCTTypeSafety
940941
- React-Codegen
941942
- React-Core
943+
- React-debug
944+
- React-Fabric
945+
- React-graphics
946+
- React-NativeModulesApple
947+
- React-RCTFabric
948+
- React-utils
949+
- ReactCommon/turbomodule/bridging
942950
- ReactCommon/turbomodule/core
951+
- Yoga
943952
- React-NativeModulesApple (0.72.1):
944953
- hermes-engine
945954
- React-callinvoker
@@ -1287,7 +1296,7 @@ SPEC CHECKSUMS:
12871296
React-jsinspector: d0b5bfd1085599265f4212034321e829bdf83cc0
12881297
React-logger: b8103c9b04e707b50cdd2b1aeb382483900cbb37
12891298
react-native-flipper: 6e4e344a0104a34a4e189a9ef2b3b5634b516dc8
1290-
react-native-performance: 426cc34043381602a59f059755a04452315effb4
1299+
react-native-performance: 8d52c16b63aa3728464aa10a1e75dff23412ea2e
12911300
React-NativeModulesApple: 4f31a812364443cee6ef768d256c594ad3b20f53
12921301
React-perflogger: 3d501f34c8d4b10cb75f348e43591765788525ad
12931302
React-RCTActionSheet: f5335572c979198c0c3daff67b07bd1ad8370c1d

packages/react-native-performance/ios/RNPerformanceManager.mm

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,6 @@
99
#import <RNPerformanceSpec/RNPerformanceSpec.h>
1010
#endif
1111

12-
static CFTimeInterval RNPerformanceGetProcessStartTime()
13-
{
14-
size_t len = 4;
15-
int mib[len];
16-
struct kinfo_proc kp;
17-
18-
sysctlnametomib("kern.proc.pid", mib, &len);
19-
mib[3] = getpid();
20-
len = sizeof(kp);
21-
sysctl(mib, 4, &kp, &len, NULL, 0);
22-
23-
struct timeval startTime = kp.kp_proc.p_un.__p_starttime;
24-
return startTime.tv_sec + startTime.tv_usec / 1e6;
25-
}
26-
2712
static int64_t sNativeLaunchStart;
2813
static int64_t sNativeLaunchEnd;
2914

@@ -38,8 +23,10 @@ @implementation RNPerformanceManager
3823
+ (void) initialize
3924
{
4025
[super initialize];
41-
sNativeLaunchStart = (RNPerformanceGetProcessStartTime() - [NSDate date].timeIntervalSince1970) * 1000 + RNPerformanceGetTimestamp();
26+
struct timespec tp;
27+
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp);
4228
sNativeLaunchEnd = RNPerformanceGetTimestamp();
29+
sNativeLaunchStart = sNativeLaunchEnd - (tp.tv_sec * 1e3 + tp.tv_nsec / 1e6);
4330
}
4431

4532
- (void)setBridge:(RCTBridge *)bridge

0 commit comments

Comments
 (0)