You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using loading a pdf that contains a large image that is runlength decoded takes long, as the decoding algorithm allocates new bytes with every step.
for example we assume the bytes of a complete white RGB-image with dimensions (3000, 4000).
We can easily construct the runtime encoding using the following code.
As the current implementation stores an immutable bytearray and then adds on top of it, it will allocate a new bytearray with every step. A simple solution is to instead use a list instead and convert to a bytearray at the end.
On a real pdf - that I'm not allowed to share - I could reduce an processing step from 17minutes down to 14s just by optimizing that function. I will create a PR with the speed up
The text was updated successfully, but these errors were encountered:
Bug report
Using loading a pdf that contains a large image that is runlength decoded takes long, as the decoding algorithm allocates new bytes with every step.
for example we assume the bytes of a complete white RGB-image with dimensions (3000, 4000).
We can easily construct the runtime encoding using the following code.
As the current implementation stores an immutable bytearray and then adds on top of it, it will allocate a new bytearray with every step. A simple solution is to instead use a list instead and convert to a bytearray at the end.
On a real pdf - that I'm not allowed to share - I could reduce an processing step from 17minutes down to 14s just by optimizing that function. I will create a PR with the speed up
The text was updated successfully, but these errors were encountered: