Repository navigation
v0.51.0 — the memo a mask should not have taken away
Fixes a regression shipped in v0.49.0
A picture of one component at no more than eight bits has at most 256 values, so
what each becomes is worked out once instead of at every pixel. v0.49.0 gated that
memo on the predicate that decides whether the picture may additionally be held as
one byte a pixel and a palette — and that predicate refuses a picture with a soft
mask, because applying a mask writes pixels and a palette is shared between them.
A masked grey picture therefore lost its memo and converted every pixel through an
Indexed space over an ICC profile: 3.93 million conversions instead of 256.
| document | v0.48.0 | v0.49.0 / v0.50.0 | v0.51.0 |
|---|---|---|---|
cerfa_10832.pdf |
31.9 ms | 369.5 ms | 31.2 ms |
cerfa_11845.pdf |
31.7 ms | 380.9 ms | 33.4 ms |
cerfa_12496.pdf |
731.7 ms | 713.5 ms | 714.3 ms (control) |
86 pages of the measured corpus were at least twice as slow, across fourteen
populations — a scanned signature under a soft mask is what forms are made of.
Why three byte-identity sweeps missed it
The output was byte-identical throughout. A proof of pixels cannot see a page
that draws the same thing eleven times slower. It was found by timing the whole
corpus per page, which is what compare -timings exists for.
Also
mayPackOneByte no longer constructs the colour space to count its components —
for an Indexed space over ICC, constructing it parses the profile. The ceiling on
one picture is now applied in two stages: loosely in decodeBase without the colour
space, exactly in samples() once the component count is in hand. Both bound the
same 256 MB.
All 3 215 corpus documents render byte-identical to v0.50.0.