-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incrementally render by sending the operator list by chunks as they're ready. #3461
Incrementally render by sending the operator list by chunks as they're ready. #3461
Conversation
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/b5ffa5c04ca1bd9/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/568cd594709cb8d/output.txt |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/568cd594709cb8d/output.txt Total script time: 24.34 mins
Image differences available at: http://107.21.233.14:8877/568cd594709cb8d/reftest-analyzer.xhtml#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/b5ffa5c04ca1bd9/output.txt Total script time: 28.95 mins
Image differences available at: http://107.22.172.223:8877/b5ffa5c04ca1bd9/reftest-analyzer.xhtml#web=eq.log |
@brendandahl This is a really impressive performance improvement! If I understand it correctly, this PR supersedes #3164. |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/69d02d7c5d405d8/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/af25a5bcae60b65/output.txt |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/69d02d7c5d405d8/output.txt Total script time: 23.75 mins
Image differences available at: http://107.21.233.14:8877/69d02d7c5d405d8/reftest-analyzer.xhtml#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/af25a5bcae60b65/output.txt Total script time: 28.19 mins
Image differences available at: http://107.22.172.223:8877/af25a5bcae60b65/reftest-analyzer.xhtml#web=eq.log |
Waiting for #3477, then I'll update this. |
@brendandahl Sounds like a great optimization! Can't wait to test out a preview. #3477 has been merged. |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/2b0994cb1fcfad2/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c275bea24571421/output.txt |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/c275bea24571421/output.txt Total script time: 24.48 mins
Image differences available at: http://107.21.233.14:8877/c275bea24571421/reftest-analyzer.xhtml#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/2b0994cb1fcfad2/output.txt Total script time: 28.24 mins
Image differences available at: http://107.22.172.223:8877/2b0994cb1fcfad2/reftest-analyzer.xhtml#web=eq.log |
function pageStartRenderingFromOperatorListEnsureFonts() { | ||
self.displayReadyPromise.resolve(); | ||
function complete(error) { | ||
for (var i = 0; i < self.renderTasks.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think var i = self.renderTasks.indexOf(internalRenderTask); if (i >= 0) ...
will look better
Looks good. We have to start playing with it more. Landing time? /botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/b6ca2f8455ffea7/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/b6ca2f8455ffea7/output.txt Total script time: 0.29 mins Published |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/77a8fbae21c47e9/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/2eb7fda7021a849/output.txt |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/77a8fbae21c47e9/output.txt Total script time: 23.03 mins
Image differences available at: http://107.21.233.14:8877/77a8fbae21c47e9/reftest-analyzer.xhtml#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/2eb7fda7021a849/output.txt Total script time: 28.61 mins
Image differences available at: http://107.22.172.223:8877/2eb7fda7021a849/reftest-analyzer.xhtml#web=eq.log |
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/78aca2dc935bfcf/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/3f28f53a05ed57b/output.txt |
Incrementally render by sending the operator list by chunks as they're ready.
That speed optimization is just... wow. :-D That large map used to take 22 seconds to be fully rendered, whereas it now takes 7 seconds! |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/78aca2dc935bfcf/output.txt Total script time: 23.24 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/3f28f53a05ed57b/output.txt Total script time: 28.72 mins
|
panel.appendChild(content); | ||
this.table = table; | ||
}, | ||
updateOperatorList: function updateOperatorList(operatorList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dead code now, because updateOperatorList
is not called anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, it is called in display/api.js
.
To make this much easier I stripped out much of uneeded promise code for getting operator lists.
I've created RenderTask/InternalRenderTask to help with rendering that make it much easier to cancel the rendering and resume when more chunks are ready. I don't really like extending the Promise for page.render(), but this way we don't break anyone's code. I've also created an OperatorList class so we have one central one that we can flush as it is built. This also cleans up a lot of code since we had little pseudo operator list objects in a number of places.
Things we should further explore:
Should also note for complex pdfs this drops the rendering time quite a bit on my machine. For instance:
http://www.sfbike.org/download/map.pdf
Old code: nothing appears for 15s, 28s to finish rendering
New: appears ~2s, 15s to finish rendering