File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Sources/swift-parser-cli/Commands Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import _InstructionCounter
14
14
import ArgumentParser
15
15
import Foundation
16
16
import SwiftParser
17
+ import SwiftSyntax
17
18
18
19
struct PerformanceTest : ParsableCommand {
19
20
static var configuration = CommandConfiguration (
@@ -39,10 +40,15 @@ struct PerformanceTest: ParsableCommand {
39
40
40
41
let start = Date ( )
41
42
let startInstructions = getInstructionsExecuted ( )
42
- for _ in 0 ..< self . iterations {
43
+ let parseTransition = IncrementalParseTransition ( )
44
+ var previousTreeDict : [ Data : SourceFileSyntax ] = [ : ]
45
+ for iter in 0 ..< self . iterations {
43
46
for file in files {
47
+ if iter != 0 {
48
+ parseTransition. setupTransition ( tree: previousTreeDict [ file] !, edits: ConcurrentEdits ( fromSequential: [ ] ) )
49
+ }
44
50
file. withUnsafeBytes { buf in
45
- _ = Parser . parse ( source: buf. bindMemory ( to: UInt8 . self) )
51
+ previousTreeDict [ file ] = Parser . parse ( source: buf. bindMemory ( to: UInt8 . self) , parseTransition : parseTransition )
46
52
}
47
53
}
48
54
}
You can’t perform that action at this time.
0 commit comments