mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
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:
parent
73bb09bdad
commit
3fa8bba48e
1 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue