From 0bd865769372041725a636ce28a834b33e114d3a Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 26 Dec 2014 18:05:41 -0500 Subject: [PATCH] Hunt-McIlroy diff is very slow for intra-line diffing --- rmacs/diff.rkt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rmacs/diff.rkt b/rmacs/diff.rkt index 91d5116..c926ef4 100644 --- a/rmacs/diff.rkt +++ b/rmacs/diff.rkt @@ -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))))))