-
Notifications
You must be signed in to change notification settings - Fork 28
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
Performance Improvements #179
Conversation
6d362ac
to
db0a1cc
Compare
@@ -83,6 +84,7 @@ fileprivate struct XcodePreviewDemoContent : BlueprintItemContent, Equatable | |||
} | |||
} | |||
|
|||
#if DEBUG && canImport(SwiftUI) && !arch(i386) && !arch(arm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes building for profiling in Instruments
@@ -8,17 +8,21 @@ | |||
import Foundation | |||
|
|||
|
|||
public final class AnyIdentifier : Hashable, CustomDebugStringConvertible | |||
public class AnyIdentifier : Hashable, CustomDebugStringConvertible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this to a class hierarchy allows free bridging to the Any type
@@ -8,7 +8,7 @@ | |||
import Foundation | |||
|
|||
|
|||
struct ArrayDiff<Element> | |||
struct ArrayDiff<Element, Identifier:Hashable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not wrapping in AnyHashable saves many allocs and function calls; which add up.
@@ -27,14 +27,6 @@ struct SectionedDiff<Section, Item> | |||
) | |||
} | |||
|
|||
static func calculate(on queue : DispatchQueue, old : [Section], new: [Section], configuration : Configuration, completion : @escaping (SectionedDiff) -> ()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
@@ -8,7 +8,7 @@ | |||
import Foundation | |||
|
|||
|
|||
struct SectionedDiff<Section, Item> | |||
struct SectionedDiff<Section, SectionIdentifier:Hashable, Item, ItemIdentifier:Hashable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting to the direct type saves trampolining through AnyHashable, which is faster for large diffs.
@@ -9,23 +9,6 @@ import XCTest | |||
import Listable | |||
|
|||
|
|||
class AnyIdentifierTests: XCTestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now an abstract type; no longer useful to test.
No description provided.