Skip to content

Commit

Permalink
Add various performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnwalraven committed May 28, 2019
1 parent 395311e commit c84fe16
Show file tree
Hide file tree
Showing 22 changed files with 446 additions and 133 deletions.
17 changes: 16 additions & 1 deletion Apollo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
9F578D901D8D2CB300C0EA36 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F578D8F1D8D2CB300C0EA36 /* Utilities.swift */; };
9F65B1211EC106F30090B25F /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; };
9F69FFA91D42855900E000B1 /* NetworkTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F69FFA81D42855900E000B1 /* NetworkTransport.swift */; };
9F7BA89922927A3700999B3B /* ResponsePath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7BA89822927A3700999B3B /* ResponsePath.swift */; };
9F8622F81EC2004200C38162 /* ReadWriteFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */; };
9F8622FA1EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F91EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift */; };
9F86B68B1E6438D700B885FF /* GraphQLSelectionSetMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F86B68A1E6438D700B885FF /* GraphQLSelectionSetMapper.swift */; };
Expand All @@ -35,6 +36,7 @@
9F8A958D1EC0FFAB00304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
9F8A95901EC0FFC100304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
9F8A95931EC0FFD100304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; };
9F8F334C229044A200C0E83B /* Decoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8F334B229044A200C0E83B /* Decoding.swift */; };
9F91CF8F1F6C0DB2008DD0BE /* MutatingResultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */; };
9FA6ABCC1EC0A9F7000017BE /* FetchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */; };
9FA6ABCD1EC0A9F7000017BE /* LoadQueryFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */; };
Expand Down Expand Up @@ -254,6 +256,7 @@
9F55347A1DE1DB2100E54264 /* ApolloStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApolloStore.swift; sourceTree = "<group>"; };
9F578D8F1D8D2CB300C0EA36 /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
9F69FFA81D42855900E000B1 /* NetworkTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkTransport.swift; sourceTree = "<group>"; };
9F7BA89822927A3700999B3B /* ResponsePath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResponsePath.swift; sourceTree = "<group>"; };
9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReadWriteFromStoreTests.swift; sourceTree = "<group>"; };
9F8622F91EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FragmentConstructionAndConversionTests.swift; sourceTree = "<group>"; };
9F8622FE1EC44A8600C38162 /* HeroNameAndAppearsIn.graphql */ = {isa = PBXFileReference; lastKnownFileType = text; path = HeroNameAndAppearsIn.graphql; sourceTree = "<group>"; };
Expand All @@ -265,6 +268,7 @@
9F8A95811EC0FD3300304A2D /* XCTAssertHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTAssertHelpers.swift; sourceTree = "<group>"; };
9F8A95831EC0FD6100304A2D /* XCTestCase+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Promise.swift"; sourceTree = "<group>"; };
9F8A95851EC0FD9800304A2D /* TestCacheProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestCacheProvider.swift; sourceTree = "<group>"; };
9F8F334B229044A200C0E83B /* Decoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoding.swift; sourceTree = "<group>"; };
9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MutatingResultsTests.swift; sourceTree = "<group>"; };
9FA6ABBC1EC0A988000017BE /* ApolloCacheDependentTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloCacheDependentTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9FA6ABC01EC0A988000017BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -436,13 +440,15 @@
isa = PBXGroup;
children = (
9FF90A5C1DDDEB100034C3B6 /* GraphQLExecutor.swift */,
9F8F334B229044A200C0E83B /* Decoding.swift */,
9FA6F3671E65DF4700BF8D73 /* GraphQLResultAccumulator.swift */,
9F86B68A1E6438D700B885FF /* GraphQLSelectionSetMapper.swift */,
9F295E371E277B2A00A24949 /* GraphQLResultNormalizer.swift */,
9FC2333C1E66BBF7001E4541 /* GraphQLDependencyTracker.swift */,
9F86B68F1E65533D00B885FF /* GraphQLResponseGenerator.swift */,
9FC9A9C41E2D6CE70023C4D5 /* GraphQLSelectionSet.swift */,
9FC9A9C11E2D3CAF0023C4D5 /* GraphQLInputValue.swift */,
9F7BA89822927A3700999B3B /* ResponsePath.swift */,
);
name = Execution;
sourceTree = "<group>";
Expand Down Expand Up @@ -771,6 +777,7 @@
buildPhases = (
9FC6312F1E6AE2080062707E /* Sources */,
9FC631301E6AE2080062707E /* Frameworks */,
9FD67EBA2290208500FD8DD2 /* Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -909,7 +916,6 @@
};
9FD637E01E6ACF88001EDBC8 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Manual;
};
};
};
Expand Down Expand Up @@ -958,6 +964,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
9FD67EBA2290208500FD8DD2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -1057,6 +1070,7 @@
files = (
9FF33D811E48B98200F608A4 /* HTTPNetworkTransport.swift in Sources */,
9FCE2CEE1E6BE2D900E34457 /* NormalizedCache.swift in Sources */,
9F8F334C229044A200C0E83B /* Decoding.swift in Sources */,
9FADC84A1E6B0B2300C677E6 /* Locking.swift in Sources */,
9F295E381E277B2A00A24949 /* GraphQLResultNormalizer.swift in Sources */,
9F86B68B1E6438D700B885FF /* GraphQLSelectionSetMapper.swift in Sources */,
Expand All @@ -1075,6 +1089,7 @@
9FC4B9201D2A6F8D0046A641 /* JSON.swift in Sources */,
9FEC15B41E681DAD00D461B4 /* Collections.swift in Sources */,
9F578D901D8D2CB300C0EA36 /* Utilities.swift in Sources */,
9F7BA89922927A3700999B3B /* ResponsePath.swift in Sources */,
9FC9A9BD1E2C271C0023C4D5 /* RecordSet.swift in Sources */,
9FEC15B91E6965E300D461B4 /* Result.swift in Sources */,
9FADC84F1E6B865E00C677E6 /* DataLoader.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>classNames</key>
<dict>
<key>ParsingTests</key>
<dict>
<key>testLargeResponse()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.88797</real>
<key>baselineIntegrationDisplayName</key>
<string>Local Baseline</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>classNames</key>
<dict>
<key>ParsingTests</key>
<dict>
<key>testLargeResponse()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>1.1037</real>
<key>baselineIntegrationDisplayName</key>
<string>Local Baseline</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>runDestinationsByUUID</key>
<dict>
<key>09B0B19E-F5A6-42CF-AD3D-082A3B8B31B3</key>
<dict>
<key>targetArchitecture</key>
<string>arm64e</string>
<key>targetDevice</key>
<dict>
<key>modelCode</key>
<string>iPhone11,2</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphoneos</string>
</dict>
</dict>
<key>22F19570-674E-47F1-A426-4EFB879DC0E3</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>100</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Intel Core i7</string>
<key>cpuSpeedInMHz</key>
<integer>2700</integer>
<key>logicalCPUCoresPerPackage</key>
<integer>8</integer>
<key>modelCode</key>
<string>MacBookPro13,3</string>
<key>physicalCPUCoresPerPackage</key>
<integer>4</integer>
<key>platformIdentifier</key>
<string>com.apple.platform.macosx</string>
</dict>
<key>targetArchitecture</key>
<string>x86_64</string>
<key>targetDevice</key>
<dict>
<key>modelCode</key>
<string>iPhone11,2</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphonesimulator</string>
</dict>
</dict>
</dict>
</dict>
</plist>
1 change: 1 addition & 0 deletions Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableThreadSanitizer = "YES"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</BuildAction>
<TestAction
buildConfiguration = "PerformanceTesting"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#include "../Shared/Project-Release.xcconfig"

COPY_PHASE_STRIP = NO
ENABLE_BITCODE = NO
ENABLE_TESTABILITY = YES
TEST_HOST = $(BUILT_PRODUCTS_DIR)/TestHost iOS.app/TestHost iOS

CODE_SIGN_IDENTITY = iPhone Developer;
CODE_SIGN_STYLE = Automatic;
13 changes: 6 additions & 7 deletions Configuration/Shared/Workspace-Universal-Framework.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ SDKROOT[sdk=macosx*] = macosx
VALID_ARCHS[sdk=macosx*] = x86_64

// Enable Bitcode only for actual devices, not for macOS or simulators
ENABLE_BITCODE[sdk=watchos*] = YES
ENABLE_BITCODE[sdk=iphoneos*] = YES
ENABLE_BITCODE[sdk=appletvos*] = YES
ENABLE_BITCODE[sdk=watchos*][config=Release] = YES
ENABLE_BITCODE[sdk=iphoneos*][config=Release] = YES
ENABLE_BITCODE[sdk=appletvos*][config=Release] = YES

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

0 comments on commit c84fe16

Please sign in to comment.