-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Make IdentityCMaps more compact. #5135
Conversation
IdentityCMap uses an array to represent a 16-bit unsigned identity function. This is very space-inefficient, and some files cause multiple IdentityCMaps to be instantiated (e.g. the one from mozilla#4580 has 74). This patch make the representation implicit. When loading the PDF from issue mozilla#4580, this change reduces peak RSS from ~370 to ~280 MiB. It also improves overall speed on that PDF by ~30%, going from 522 ms to 366 ms.
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/2a1b63b66634ec9/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/2a1b63b66634ec9/output.txt Total script time: 0.75 mins Published
|
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/6add700436da8e4/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/5536969f090a58a/output.txt |
Nice; this patch also improves the performance of #4935. |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/5536969f090a58a/output.txt Total script time: 19.63 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/6add700436da8e4/output.txt Total script time: 22.57 mins
|
The rendering time for #4935 went down from 12225 ms to 7077 ms, a 43% decrease! |
And peak RSS dropped from ~2800 MiB to ~2400. Still too high, though; I'll do some more profiling. |
Make IdentityCMaps more compact.
Really good. Thank you for the patch. |
IdentityCMap uses an array to represent a 16-bit unsigned identity
function. This is very space-inefficient, and some files cause multiple
IdentityCMaps to be instantiated (e.g. the one from #4580 has 74).
This patch make the representation implicit.
When loading the PDF from issue #4580, this change reduces peak RSS from
~370 to ~280 MiB. It also improves overall speed on that PDF by ~30%,
going from 522 ms to 366 ms.