1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Benchmark diffing within leaves separately.

This commit is contained in:
Rob Rix 2015-11-12 15:07:00 -05:00
parent a4db95be66
commit db5307a365

View File

@ -178,7 +178,8 @@ let parser = parserForType(aSource.type)
let a = try benchmark("parsing source a") { try parser(aSource.contents) }
let b = try benchmark("parsing source b") { try parser(bSource.contents) }
let diff = benchmark("diffing") { Interpreter<Term>(equal: Term.equals(annotation: const(true), leaf: ==), comparable: Interpreter<Term>.comparable { $0.extract.categories }, cost: Free.sum(Patch.sum)).run(a, b).flatMap(refineLeafReplacement(aSource.contents, bSource.contents)) }
let initialDiff = benchmark("diffing") { Interpreter<Term>(equal: Term.equals(annotation: const(true), leaf: ==), comparable: Interpreter<Term>.comparable { $0.extract.categories }, cost: Free.sum(Patch.sum)).run(a, b) }
let diff = benchmark("diffing within leaves") { initialDiff.flatMap(refineLeafReplacement(aSource.contents, bSource.contents)) }
switch arguments.output {
case .Split:
let JSON: Doubt.JSON = [