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.
This commit is contained in:
Kalervo Kujala 2011-08-23 23:21:15 +03:00
parent 73bb09bdad
commit 3fa8bba48e

View File

@ -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();
}