This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Description
Hi,
i am trying to implement a text-base diff viewer, my code looks like the following:
let originalLines = originalSource.split(separator: "\n", omittingEmptySubsequences: false).map{String($0)}
let diffLines = diffSource.split(separator: "\n", omittingEmptySubsequences: false).map{String($0)}
let algorithmStart = CACurrentMediaTime()
let diffchecker = WagnerFischer<String>(reduceMove: false)
let changes = diffchecker.diff(old: originalLines, new: diffLines)
DC_LOG_INFO("DiffVC, diff algorithm cost \(CACurrentMediaTime() - algorithmStart)")
my sample files are 2 objc source files with 650+lines, and only 1 line is different , and the log prints out:
DiffVC, diff algorithm cost 6.890240641998389
Any idea of why this is so slow?