Hunt-McIlroy diff is very slow for intra-line diffing

This commit is contained in:
Tony Garnock-Jones 2014-12-26 18:05:41 -05:00
parent 2c21bcd58a
commit 0bd8657693
1 changed files with 12 additions and 1 deletions

View File

@ -123,4 +123,15 @@
'((1 0 1 1) (2 2 3 1)))
(check-equal? (longest-common-subsequence '(a b c) '(d e f)) '())
(check-equal? (diff-indices '(a b c) '(d e f)) '((0 3 0 3))))
(check-equal? (diff-indices '(a b c) '(d e f)) '((0 3 0 3)))
(let ((size 400))
(local-require profile)
(profile-thunk
(lambda ()
(diff-indices (make-vector size 'x)
(let ((v (make-vector size 'x)))
(vector-set! v 0 'a)
(vector-set! v 1 'b)
(vector-set! v 2 'c)
v))))))