Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering slowing down from 300ms to >3000 in Firefox #6977

Closed
mbmleone opened this issue Feb 12, 2016 · 9 comments
Closed

Rendering slowing down from 300ms to >3000 in Firefox #6977

mbmleone opened this issue Feb 12, 2016 · 9 comments

Comments

@mbmleone
Copy link

There seems to be a problem with rendering speed in Firefox of specific large PDFs.
For example this file:
testfile.pdf
The first pages of this file render in roughly 300ms.
After rendering a couple pages it increases, eventually resulting in delays of 3000-4000ms .
The pages are the exactly the same, so delay may not increase.

This happens independently of the order in which you render the pages.
This increasing delay happens in Firefox.
Chrome doesn't show it.
In MS Edge it also increases, there the delay increase is smaller, but happens sooner.
So the investigation should focus on Firefox.

I have made a test to show this:
https://jsfiddle.net/7xm2Ltfh/7/

Try it in this way:
(1) Select the provided PDF
(2) Press Test 1.
(3) Delays of rendering full page will be printed.

Test 1 simply renders the pages one after each other.
Here you see the delay increasing and the latest delays will be >3000ms.

Test 2 reloads the PDF after each rendering.
That doesn't show the increase in rendering speed, but does have reload delay.

Hopefully one of you has on idea what causes this issue.

@yurydelendik
Copy link
Contributor

Looks good for me:

screen shot 2016-02-12 at 9 11 07 am

Please provide more information, e.g. versions of operating system and browser.

@mbmleone
Copy link
Author

Firefox 44.0.1 - Windows 10

delay

@yurydelendik
Copy link
Contributor

Looks like it's related to the version of the FF. Can you try it in the latest FF Nightly?

@yurydelendik
Copy link
Contributor

@mbmleone
Copy link
Author

Tried FF45, that does indeed fix this problem, thanks for checking that!

Then there is still the increase in MS Edge:

testfile.pdf
data read delay:77
pdf read delay:390
Render Delay:167+370=537
Render Delay:174+363=537
Render Delay:166+1510=1676
Render Delay:160+1510=1670
Render Delay:156+1520=1676
Render Delay:169+1503=1672
Render Delay:165+1496=1661
Render Delay:158+1499=1657
Render Delay:158+1535=1693
Render Delay:176+1502=1678
Render Delay:160+1527=1687
Render Delay:162+1519=1681
Render Delay:164+1550=1714
Render Delay:168+1527=1695
Render Delay:168+1530=1698
Render Delay:163+1498=1661
TOTAL DELAY:25091

Do you think that's also a browser issue?

@mbmleone
Copy link
Author

For MS Edge I use 25.10586.0.0

@yurydelendik
Copy link
Contributor

Do you think that's also a browser issue?

It's hard to tell. PDF.js is created for generic HTML5 platform, but we still have few places (e.g. Font or PDF loading) when logic is different for different browsers. However your issue looks more JS engine or CANVAS performance bound. Implementations of those differ across browsers.

@yurydelendik
Copy link
Contributor

More info fixed by:

changeset:   273266:769ffacadef5
parent:      273264:775cc28c73b3
user:        Jan de Mooij <jdemooij@mozilla.com>
date:        Thu Nov 19 10:13:28 2015 +0100
summary:     Bug 1225821 - Add type write barrier to SetPropertyIC dense element stub. r=bhackett

https://bugzilla.mozilla.org/show_bug.cgi?id=1225821

which indicates that some code was not efficiently compiled by JavaScript JIT. Maybe Edge has are the same issue, and it will not be fixed unless reported to the IE team.

@mbmleone
Copy link
Author

Thanks for help.
Tests confirm it's caused by Edge itself, but it's not something always happens.
On my website the speed is now acceptable, so I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants