Skip to content

[Perf] Drop Some Places We Re-Materialize Input Files #554

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

Merged
merged 2 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal extension Driver {
}

// Pass on the input files
commandLine.append(contentsOf: inputFiles.map { .path($0.file)})
commandLine.append(contentsOf: inputFiles.map { .path($0.file) })
return (inputs, commandLine)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,12 @@ extension OutputFileMap {
// MARK: SourceFiles
@_spi(Testing) public struct SourceFiles {
let currentInOrder: [TypedVirtualPath]
private let currentSet: Set<VirtualPath>
let previous: Set<VirtualPath>
private let previous: Set<VirtualPath>
let disappeared: [VirtualPath]

init(inputFiles: [TypedVirtualPath], buildRecord: BuildRecord?) {
self.currentInOrder = inputFiles.filter {$0.type == .swift}
let currentSet = Set(currentInOrder.map {$0.file} )
self.currentSet = currentSet
self.previous = buildRecord.map {
Set($0.inputInfos.keys)
} ?? Set()
Expand Down
4 changes: 1 addition & 3 deletions Sources/SwiftDriver/Jobs/EmitModuleJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ extension Driver {

commandLine.appendFlags("-frontend", "-emit-module", "-experimental-skip-non-inlinable-function-bodies-without-types")

let swiftInputFiles = inputFiles.filter { $0.type.isPartOfSwiftCompilation }

// Add the inputs.
for input in swiftInputFiles {
for input in self.inputFiles where input.type.isPartOfSwiftCompilation {
commandLine.append(.path(input.file))
inputs.append(input)
}
Expand Down