News for hackers. Stuff that matters.
Re:How fast is PDF.js? by acqq on Thursday May 08, 2014 @05:10PM (#7717736)
Thanks! Good work! It's of much more benefit to analyze slow pdfs than to construct the "proofs" that short and simple pdfs are displayed "fast enough" (but I understand that the later feels so good). Especially since it seems that not only pdf.js will benefit from analyzing the slow ones -- if I understand you traced the problems to the cpp code of the browser? That would mean that even non-pdf-js stuff will be faster once it's fixed, is that correct?
Re:How fast is PDF.js? by bgirard on Thursday May 08, 2014 @05:26PM (#7717796)
Yes the fix to bug 1007897 will help all web content.

That profile will show calls from JS and how theycall into native C++ calls. This is very useful for profiling things like canvas.

PDF.js isn't bottlenecked by javascript performance, like many well tuned apps out there, so there's a lot of improvements that can be made by tweaking the web platform.

Re:How fast is PDF.js? by slacka on Friday May 09, 2014 @01:52AM (#7719573)
Does your profile explain why large PDFs are so laggy when scrolling in PDF.js? For example take http://www.math.mtu.edu/~msgocken/pdebook2/mapletut2.pdf open it in FF and hold the page down or up. On my laptop, that will lockup FF. Yet, if I open it in Acrobat Reader or Chrome, I can scroll up and down much faster without the jerky behavior.

It is even possible a JavaScript app in FF to get the kind of performance Google gets with their pdf plugin? With the power of today's PC's, it seems like something is seriously wrong with "web technology" if my machine struggles to render pdf documents.

Re:How fast is PDF.js? by acqq on Thursday May 08, 2014 @05:46PM (#7717908)
Wonderful! You diagnose so fast it looks like magic! Do you see anything new when profiling this one:

http://www.engageny.org/sites/default/files/resource/attachm...

and

http://www.math.mtu.edu/~msgocken/pdebook2/mapletut2.pdf

Re:How fast is PDF.js? by bgirard on Thursday May 08, 2014 @06:32PM (#7718122)
http://people.mozilla.org/~bgirard/cleopatra/#report=a848ab9...

The first PDF.js document uses the DOM instead of Canvas like the previous one. This is done to support text selection. Most of the time is spent in the style system. I don't know that area very well but in the past I've seen simplifying CSS selectors make all the difference. I know a fairly important problem for B2G is spending up expensive style flush (https://bugzilla.mozilla.org/show_bug.cgi?id=931668) but I don't know enough about CSS to know if that fix will solve the problem here.