Skip to content

Give a page a time budget, and take the fixes from underneath - #6

Open
tannevaled wants to merge 1 commit into
mainfrom
bump-pdfkit-deps
Open

Give a page a time budget, and take the fixes from underneath#6
tannevaled wants to merge 1 commit into
mainfrom
bump-pdfkit-deps

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Measurements are being run now and will be added to this body before review.

ops v0.5.0 -> v0.6.0, render v0.7.0 -> v0.8.0, reader v0.4.1 -> v0.4.2,
pdffont -> v0.3.0 indirect. opentype comes along to v0.10.0 because render
v0.8.0 asks for it.

What the workbench gains without asking:

  - Annotations are drawn. A filled-in form used to appear empty, because
    what a person typed lives in the widget beside the content, not in it.
  - Soft masks, and a transparency group drawn as one thing.
  - A composite font's identifiers reach its glyphs through the charset, so
    a CIDFontType2 subset carrying no cmap no longer hides every glyph.
  - A clip is kept as the box it covers rather than as a value for every
    pixel of the page.
  - A form's field list survives a rotate, so the boxes on the page keep
    their meaning.
  - An inline image's dictionary is read in a settled order, so a page
    carrying both spellings of a key -- /W beside /Width -- no longer draws
    differently from one run to the next.

What it had to ask for is the time budget. render v0.8.0 will stop drawing
a page when its time is up and hand back as far as it got, but only if the
caller says how long -- and a browser tab is exactly the caller that cannot
wait: of 59 432 corpus pages, 1 131 were still being drawn after twenty
seconds and one took two hundred and seventy-three. So renderPage sets five
seconds, and shows the part that was drawn instead of treating ErrTimedOut
as a page that cannot be drawn at all. Half a figure is worth more to
somebody scrolling than a sentence saying there was one.
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

Successfully merging this pull request may close these issues.

1 participant