You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Much faster navigator index creation for mixed Swift and Objective-C projects (#917)
* Fix a navigator index performance for mixed Swift/Objective-C projects
rdar://127759734
* Use new apply-patch function in other places
* Deprecate unused `RenderNode/childrenRelationship(for:)`
* Move inner function in test to avoid warning about captured state
* Fix unrelated issue where the language in disambiguated references wasn't stable
* Move new indexable-render-node-representation protocol top-level
* Remove extra word in code comment
Co-authored-by: Maya Epps <[email protected]>
---------
Co-authored-by: Maya Epps <[email protected]>
// A render node is structured differently depending on if it was created by "rendering" a documentation node
640
+
// or if it was deserialized from a documentation archive.
641
+
//
642
+
// If it was created by rendering a documentation node, all variant information is stored in each individual variant collection and the variant overrides are nil.
643
+
// If it was deserialized from a documentation archive, all variant information is stored in the variant overrides and the variant collections are empty.
644
+
645
+
// Operating on the variant override is _significantly_ slower, so we only take that code path if we have to.
646
+
// The only reason why this code path still exists is to support the `docc process-archive index` command, which creates an navigation index from an already build documentation archive.
// This code looks peculiar and very inefficient because it is.
649
+
// I didn't write it and I really wanted to remove it, but it's the only way to support the `docc process-archive index` command for now.
650
+
// rdar://128050800 Tracks fixing the inefficiencies with this code, to make `docc process-archive index` command as fast as indexing during a `docc convert` command.
651
+
//
652
+
// First, it encodes the render node, which was read from a file, back to data; because that's what the overrides applier operates on
// Finally, the decoded node is in a way flattened, so that it only contains its Objective-C content. That's why we pass `nil` instead of `[objCVariantTrait]` to this call.
662
+
_ =tryindex(variantRenderNode, traits:nil)
663
+
}
664
+
665
+
// If this render node was created by rendering a documentation node, we create a "view" into its Objective-C specific data and index that.
guardlet title =(usePageTitle)? renderNode.metadata.title : renderNode.navigatorTitle()else{
699
+
guardlet title = usePageTitle ? renderNode.metadata.title : renderNode.navigatorTitle()else{
650
700
throwError.missingTitle(description:"\(renderNode.identifier.absoluteString.singleQuoted) has an empty title and so can't have a usable entry in the index.")
651
701
}
652
702
@@ -724,13 +774,11 @@ extension NavigatorIndex {
724
774
navigationItem.usrIdentifier = language.name +"-"+ ExternalIdentifier.usr(usr).hash // We pair the hash and the language name
0 commit comments