From 3fa8bba48e3933c36bf60a43defefcc6fad26571 Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Tue, 23 Aug 2011 23:21:15 +0300 Subject: [PATCH] Make 'make test' factors faster. Profiling with firebug reveals that log and checkScrolling functions slow down the 'make test' by factors. Use insertAdjacentHtml in the log fucntion insteand of appending to innerHTML. Also call checkScrolling function only when it is prudent to do instead of unnecessarily in every log function call. --- test/driver.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/driver.js b/test/driver.js index 716046c4b..cbb226dda 100644 --- a/test/driver.js +++ b/test/driver.js @@ -221,6 +221,8 @@ function checkScrolling() { } function log(str) { - stdout.innerHTML += str; - checkScrolling(); + stdout.insertAdjacentHTML("BeforeEnd", str); + + if (str.charAt(str.length - 1) == '\n') + checkScrolling(); }