Skip to content

Commit c84fe16

Browse files
Add various performance improvements
1 parent 395311e commit c84fe16

22 files changed

Lines changed: 446 additions & 133 deletions

Apollo.xcodeproj/project.pbxproj

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
9F578D901D8D2CB300C0EA36 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F578D8F1D8D2CB300C0EA36 /* Utilities.swift */; };
2525
9F65B1211EC106F30090B25F /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; };
2626
9F69FFA91D42855900E000B1 /* NetworkTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F69FFA81D42855900E000B1 /* NetworkTransport.swift */; };
27+
9F7BA89922927A3700999B3B /* ResponsePath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7BA89822927A3700999B3B /* ResponsePath.swift */; };
2728
9F8622F81EC2004200C38162 /* ReadWriteFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */; };
2829
9F8622FA1EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F91EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift */; };
2930
9F86B68B1E6438D700B885FF /* GraphQLSelectionSetMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F86B68A1E6438D700B885FF /* GraphQLSelectionSetMapper.swift */; };
@@ -35,6 +36,7 @@
3536
9F8A958D1EC0FFAB00304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
3637
9F8A95901EC0FFC100304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
3738
9F8A95931EC0FFD100304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
39+
9F8F334C229044A200C0E83B /* Decoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8F334B229044A200C0E83B /* Decoding.swift */; };
3840
9F91CF8F1F6C0DB2008DD0BE /* MutatingResultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */; };
3941
9FA6ABCC1EC0A9F7000017BE /* FetchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */; };
4042
9FA6ABCD1EC0A9F7000017BE /* LoadQueryFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */; };
@@ -254,6 +256,7 @@
254256
9F55347A1DE1DB2100E54264 /* ApolloStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApolloStore.swift; sourceTree = "<group>"; };
255257
9F578D8F1D8D2CB300C0EA36 /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
256258
9F69FFA81D42855900E000B1 /* NetworkTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkTransport.swift; sourceTree = "<group>"; };
259+
9F7BA89822927A3700999B3B /* ResponsePath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResponsePath.swift; sourceTree = "<group>"; };
257260
9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReadWriteFromStoreTests.swift; sourceTree = "<group>"; };
258261
9F8622F91EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FragmentConstructionAndConversionTests.swift; sourceTree = "<group>"; };
259262
9F8622FE1EC44A8600C38162 /* HeroNameAndAppearsIn.graphql */ = {isa = PBXFileReference; lastKnownFileType = text; path = HeroNameAndAppearsIn.graphql; sourceTree = "<group>"; };
@@ -265,6 +268,7 @@
265268
9F8A95811EC0FD3300304A2D /* XCTAssertHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTAssertHelpers.swift; sourceTree = "<group>"; };
266269
9F8A95831EC0FD6100304A2D /* XCTestCase+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Promise.swift"; sourceTree = "<group>"; };
267270
9F8A95851EC0FD9800304A2D /* TestCacheProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestCacheProvider.swift; sourceTree = "<group>"; };
271+
9F8F334B229044A200C0E83B /* Decoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoding.swift; sourceTree = "<group>"; };
268272
9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MutatingResultsTests.swift; sourceTree = "<group>"; };
269273
9FA6ABBC1EC0A988000017BE /* ApolloCacheDependentTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloCacheDependentTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
270274
9FA6ABC01EC0A988000017BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -436,13 +440,15 @@
436440
isa = PBXGroup;
437441
children = (
438442
9FF90A5C1DDDEB100034C3B6 /* GraphQLExecutor.swift */,
443+
9F8F334B229044A200C0E83B /* Decoding.swift */,
439444
9FA6F3671E65DF4700BF8D73 /* GraphQLResultAccumulator.swift */,
440445
9F86B68A1E6438D700B885FF /* GraphQLSelectionSetMapper.swift */,
441446
9F295E371E277B2A00A24949 /* GraphQLResultNormalizer.swift */,
442447
9FC2333C1E66BBF7001E4541 /* GraphQLDependencyTracker.swift */,
443448
9F86B68F1E65533D00B885FF /* GraphQLResponseGenerator.swift */,
444449
9FC9A9C41E2D6CE70023C4D5 /* GraphQLSelectionSet.swift */,
445450
9FC9A9C11E2D3CAF0023C4D5 /* GraphQLInputValue.swift */,
451+
9F7BA89822927A3700999B3B /* ResponsePath.swift */,
446452
);
447453
name = Execution;
448454
sourceTree = "<group>";
@@ -771,6 +777,7 @@
771777
buildPhases = (
772778
9FC6312F1E6AE2080062707E /* Sources */,
773779
9FC631301E6AE2080062707E /* Frameworks */,
780+
9FD67EBA2290208500FD8DD2 /* Resources */,
774781
);
775782
buildRules = (
776783
);
@@ -909,7 +916,6 @@
909916
};
910917
9FD637E01E6ACF88001EDBC8 = {
911918
CreatedOnToolsVersion = 8.2.1;
912-
ProvisioningStyle = Manual;
913919
};
914920
};
915921
};
@@ -958,6 +964,13 @@
958964
);
959965
runOnlyForDeploymentPostprocessing = 0;
960966
};
967+
9FD67EBA2290208500FD8DD2 /* Resources */ = {
968+
isa = PBXResourcesBuildPhase;
969+
buildActionMask = 2147483647;
970+
files = (
971+
);
972+
runOnlyForDeploymentPostprocessing = 0;
973+
};
961974
/* End PBXResourcesBuildPhase section */
962975

963976
/* Begin PBXShellScriptBuildPhase section */
@@ -1057,6 +1070,7 @@
10571070
files = (
10581071
9FF33D811E48B98200F608A4 /* HTTPNetworkTransport.swift in Sources */,
10591072
9FCE2CEE1E6BE2D900E34457 /* NormalizedCache.swift in Sources */,
1073+
9F8F334C229044A200C0E83B /* Decoding.swift in Sources */,
10601074
9FADC84A1E6B0B2300C677E6 /* Locking.swift in Sources */,
10611075
9F295E381E277B2A00A24949 /* GraphQLResultNormalizer.swift in Sources */,
10621076
9F86B68B1E6438D700B885FF /* GraphQLSelectionSetMapper.swift in Sources */,
@@ -1075,6 +1089,7 @@
10751089
9FC4B9201D2A6F8D0046A641 /* JSON.swift in Sources */,
10761090
9FEC15B41E681DAD00D461B4 /* Collections.swift in Sources */,
10771091
9F578D901D8D2CB300C0EA36 /* Utilities.swift in Sources */,
1092+
9F7BA89922927A3700999B3B /* ResponsePath.swift in Sources */,
10781093
9FC9A9BD1E2C271C0023C4D5 /* RecordSet.swift in Sources */,
10791094
9FEC15B91E6965E300D461B4 /* Result.swift in Sources */,
10801095
9FADC84F1E6B865E00C677E6 /* DataLoader.swift in Sources */,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>classNames</key>
6+
<dict>
7+
<key>ParsingTests</key>
8+
<dict>
9+
<key>testLargeResponse()</key>
10+
<dict>
11+
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
12+
<dict>
13+
<key>baselineAverage</key>
14+
<real>0.88797</real>
15+
<key>baselineIntegrationDisplayName</key>
16+
<string>Local Baseline</string>
17+
</dict>
18+
</dict>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>classNames</key>
6+
<dict>
7+
<key>ParsingTests</key>
8+
<dict>
9+
<key>testLargeResponse()</key>
10+
<dict>
11+
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
12+
<dict>
13+
<key>baselineAverage</key>
14+
<real>1.1037</real>
15+
<key>baselineIntegrationDisplayName</key>
16+
<string>Local Baseline</string>
17+
</dict>
18+
</dict>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>runDestinationsByUUID</key>
6+
<dict>
7+
<key>09B0B19E-F5A6-42CF-AD3D-082A3B8B31B3</key>
8+
<dict>
9+
<key>targetArchitecture</key>
10+
<string>arm64e</string>
11+
<key>targetDevice</key>
12+
<dict>
13+
<key>modelCode</key>
14+
<string>iPhone11,2</string>
15+
<key>platformIdentifier</key>
16+
<string>com.apple.platform.iphoneos</string>
17+
</dict>
18+
</dict>
19+
<key>22F19570-674E-47F1-A426-4EFB879DC0E3</key>
20+
<dict>
21+
<key>localComputer</key>
22+
<dict>
23+
<key>busSpeedInMHz</key>
24+
<integer>100</integer>
25+
<key>cpuCount</key>
26+
<integer>1</integer>
27+
<key>cpuKind</key>
28+
<string>Intel Core i7</string>
29+
<key>cpuSpeedInMHz</key>
30+
<integer>2700</integer>
31+
<key>logicalCPUCoresPerPackage</key>
32+
<integer>8</integer>
33+
<key>modelCode</key>
34+
<string>MacBookPro13,3</string>
35+
<key>physicalCPUCoresPerPackage</key>
36+
<integer>4</integer>
37+
<key>platformIdentifier</key>
38+
<string>com.apple.platform.macosx</string>
39+
</dict>
40+
<key>targetArchitecture</key>
41+
<string>x86_64</string>
42+
<key>targetDevice</key>
43+
<dict>
44+
<key>modelCode</key>
45+
<string>iPhone11,2</string>
46+
<key>platformIdentifier</key>
47+
<string>com.apple.platform.iphonesimulator</string>
48+
</dict>
49+
</dict>
50+
</dict>
51+
</dict>
52+
</plist>

Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
enableThreadSanitizer = "YES"
2930
shouldUseLaunchSchemeArgsEnv = "NO">
3031
<Testables>
3132
<TestableReference

Apollo.xcodeproj/xcshareddata/xcschemes/ApolloPerformanceTests.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</BuildAction>
99
<TestAction
1010
buildConfiguration = "PerformanceTesting"
11-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
11+
selectedDebuggerIdentifier = ""
12+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
1313
shouldUseLaunchSchemeArgsEnv = "YES">
1414
<Testables>
1515
<TestableReference
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#include "../Shared/Project-Release.xcconfig"
22

3+
COPY_PHASE_STRIP = NO
4+
ENABLE_BITCODE = NO
35
ENABLE_TESTABILITY = YES
46
TEST_HOST = $(BUILT_PRODUCTS_DIR)/TestHost iOS.app/TestHost iOS
7+
8+
CODE_SIGN_IDENTITY = iPhone Developer;
9+
CODE_SIGN_STYLE = Automatic;

Configuration/Shared/Workspace-Universal-Framework.xcconfig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ SDKROOT[sdk=macosx*] = macosx
2222
VALID_ARCHS[sdk=macosx*] = x86_64
2323

2424
// Enable Bitcode only for actual devices, not for macOS or simulators
25-
ENABLE_BITCODE[sdk=watchos*] = YES
26-
ENABLE_BITCODE[sdk=iphoneos*] = YES
27-
ENABLE_BITCODE[sdk=appletvos*] = YES
25+
ENABLE_BITCODE[sdk=watchos*][config=Release] = YES
26+
ENABLE_BITCODE[sdk=iphoneos*][config=Release] = YES
27+
ENABLE_BITCODE[sdk=appletvos*][config=Release] = YES
2828

2929
// By default, BITCODE_GENERATION_MODE is "marker".
3030
// Based on Realm's fix for Bitcode, this needs to be "bitcode"
3131
// Source: https://github.com/realm/realm-cocoa/pull/2567
32-
BITCODE_GENERATION_MODE[sdk=watchos*] = bitcode
33-
BITCODE_GENERATION_MODE[sdk=iphoneos*] = bitcode
34-
BITCODE_GENERATION_MODE[sdk=iphoneos*][config=Debug] = marker
35-
BITCODE_GENERATION_MODE[sdk=appletvos*] = bitcode
32+
BITCODE_GENERATION_MODE[sdk=watchos*][config=Release] = bitcode
33+
BITCODE_GENERATION_MODE[sdk=iphoneos*][config=Release] = bitcode
34+
BITCODE_GENERATION_MODE[sdk=appletvos*][config=Release] = bitcode

0 commit comments

Comments
 (0)