From 98f8d7f51c32718e741d4daa60f4fa9aeeee3bfb Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Thu, 14 Jan 2021 15:11:15 -0500 Subject: [PATCH] Set the diff-match-patch timeout to 100ms This might result in worse diffs, but we don't want to spend a second blocking the event loop while we figure out nicer diffs when comparing documents. --- services/document-updater/app/js/DiffCodec.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/document-updater/app/js/DiffCodec.js b/services/document-updater/app/js/DiffCodec.js index 359b91e2a7..59b7dee67b 100644 --- a/services/document-updater/app/js/DiffCodec.js +++ b/services/document-updater/app/js/DiffCodec.js @@ -1,6 +1,9 @@ const DMP = require('diff-match-patch') const dmp = new DMP() +// Do not attempt to produce a diff for more than 100ms +dmp.Diff_Timeout = 0.1 + module.exports = { ADDED: 1, REMOVED: -1,