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

Convert to synchronous GraphQL execution and data loading #1531

Merged
merged 20 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
25e3f06
Fix building performance tests for simulator
martijnwalraven Nov 17, 2020
0f9a660
Convert to synchronous GraphQL execution and data loading
martijnwalraven Nov 18, 2020
f15e2a5
Remove now unnecessary read/write lock from ApolloStore
martijnwalraven Nov 20, 2020
e1a7c85
Add lock to GraphQLQueryWatcher to avoid race conditions
martijnwalraven Nov 20, 2020
31c7e24
Make `DataLoader.load` private
martijnwalraven Nov 21, 2020
5bcff6a
Avoid nested `map` in `GraphQLExecutor`
martijnwalraven Nov 21, 2020
6110231
Document PossiblyDeferred and add tests
martijnwalraven Nov 21, 2020
78f84e5
Add comment about `ReferenceResolver` to `GraphQLExecutor`
martijnwalraven Nov 21, 2020
cc70b29
Add completion handler to ApolloStore.publish
martijnwalraven Nov 24, 2020
9b3d7ed
Assert on unhandled failures in returnResultAsyncIfNeeded
martijnwalraven Nov 24, 2020
5cfc96d
Delegate ApolloStore.load(query:) completion to `withinReadTransaction`
martijnwalraven Nov 24, 2020
2c0341d
Import Foundation instead of Dispatch
martijnwalraven Nov 24, 2020
4c8a3e2
Make single liner more readable
martijnwalraven Nov 24, 2020
0b42988
Make DataLoaderTests more readable
martijnwalraven Nov 24, 2020
dd0f6c7
Mention reference resolver in GraphQLExecutor init comments
martijnwalraven Nov 24, 2020
968e404
Avoid one liner in GraphQLExecutor
martijnwalraven Nov 24, 2020
0a5c527
Replace direct lock use with Atomic wrappers in GraphQLQueryWatcher
martijnwalraven Nov 24, 2020
56bc70c
Avoid one-liner
martijnwalraven Nov 26, 2020
256a4bc
Guard ApolloCore import when using CocoaPods
martijnwalraven Nov 26, 2020
9803e27
Merge branch 'main' into synchronous-execution
martijnwalraven Nov 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 12 additions & 24 deletions Apollo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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>ParsingPerformanceTests</key>
<dict>
<key>testParseResult()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.075663</real>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you setting up the perf tests to run in this PR? If so, we should probably get a baseline from CI rather than from one of our (almost certainly faster) local machines.

If it's not on this PR, keep that in mind for when we turn it on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I haven't looked into establishing a baseline on CI. That would have to somehow remember the results and make a commit, not sure how other projects handle that. I also don't think we should run performance tests on CI by default, because they are pretty costly (they need a whole separate optimized build). So it might be ok to only run them locally for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can set up a separate job to do the perf tests after merges - I'd definitely like to have them automated and running frequently, but it does make sense not to have them be a blocker to merging PRs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this should be handled in a separate PR thoguh)

<key>baselineIntegrationDisplayName</key>
<string>17 Nov 2020 at 14:11:59</string>
</dict>
</dict>
<key>testParseResultFast()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.016628</real>
<key>baselineIntegrationDisplayName</key>
<string>17 Nov 2020 at 14:11:59</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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>ParsingPerformanceTests</key>
<dict>
<key>testParseResult()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.09509</real>
<key>baselineIntegrationDisplayName</key>
<string>17 Nov 2020 at 13:47:48</string>
</dict>
</dict>
<key>testParseResultFast()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.017559</real>
<key>baselineIntegrationDisplayName</key>
<string>17 Nov 2020 at 13:47:48</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?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>7A4A2454-7A24-425D-84C2-116320B87F1E</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>100</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Quad-Core 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>iPhone12,3</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphonesimulator</string>
</dict>
</dict>
<key>FA3A7E89-3F08-4E7F-890A-B0903F68A94C</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>100</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Quad-Core 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>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "../Shared/Project-Release.xcconfig"

ONLY_ACTIVE_ARCH = YES

COPY_PHASE_STRIP = NO
ENABLE_BITCODE = NO
ENABLE_TESTABILITY = YES
Loading