Add more timing logs
This commit is contained in:
parent
23e9064f17
commit
1ac7064cad
@ -347,7 +347,7 @@ function WorkerPDFDoc(canvas) {
|
|||||||
|
|
||||||
var renderData = function() {
|
var renderData = function() {
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
console.time("canvas rendering");
|
console.time("main canvas rendering");
|
||||||
var ctx = this.ctx;
|
var ctx = this.ctx;
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.fillStyle = "rgb(255, 255, 255)";
|
ctx.fillStyle = "rgb(255, 255, 255)";
|
||||||
@ -355,7 +355,10 @@ function WorkerPDFDoc(canvas) {
|
|||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
renderProxyCanvas(canvasList[id], cmdQueue);
|
renderProxyCanvas(canvasList[id], cmdQueue);
|
||||||
if (id == 0) console.timeEnd("canvas rendering")
|
if (id == 0) {
|
||||||
|
console.timeEnd("main canvas rendering");
|
||||||
|
console.timeEnd(">>> total page display time:");
|
||||||
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
if (this.waitingForFonts) {
|
if (this.waitingForFonts) {
|
||||||
@ -403,6 +406,8 @@ WorkerPDFDoc.prototype.open = function(url, callback) {
|
|||||||
|
|
||||||
WorkerPDFDoc.prototype.showPage = function(numPage) {
|
WorkerPDFDoc.prototype.showPage = function(numPage) {
|
||||||
this.numPage = parseInt(numPage);
|
this.numPage = parseInt(numPage);
|
||||||
|
console.log("=== start rendering page " + numPage + " ===");
|
||||||
|
console.time(">>> total page display time:");
|
||||||
this.worker.postMessage(numPage);
|
this.worker.postMessage(numPage);
|
||||||
if (this.onChangePage) {
|
if (this.onChangePage) {
|
||||||
this.onChangePage(numPage);
|
this.onChangePage(numPage);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user