-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
slow initial rendering on latex doc with interesting fonts #4935
Comments
I can confirm this using Windows 7 x64, Firefox Nightly 30.0a1 (64-bit, HWA on) and the latest PDF.js development version. Memory consumption is also high. |
Oh, wow! This PDF embeds about 500 fonts -- I guess one per letter :) |
Remarkably, it loads quite fast in evince. |
Right.... we are allocating too many cMaps and toUnicodes (even for Identity) -- in Chrome profiler size for those two ~2.6M and we have 420 of them. |
Pretty much all the activity is here, from
This loop is executed 400+ times, and every single time The best thing would be to avoid building the maps altogether, similar to #5135. This will probably require abstracting these tables into a class, doing all accesses via getter/setter methods, and then having a special sub-class for identity maps. |
When loading the PDF from issue mozilla#4935, this change reduces peak RSS from ~2400 to ~300 MiB, and improves overall speed by ~81%, from 6336 ms to 1222 ms.
This document renders very slowly -- first a few characters appear, then it spins for a long time, and then everything else appears quickly.
This is with FF 32.0a1, PDF.js: 0.8.1334, Linux. No warnings on the console.
The text was updated successfully, but these errors were encountered: