Lazy validation
Internally, page has 2 validation modes: exhaustive and lazy. Whether it should use one or the other only depends on what the user asks for and is automatically handled. The lazy mode will return as early as possible and avoid spending time checking rules if the user only cares about whether the PDF is compliant or not.
In practice, the lazy mode will stop at the very first failed rule it finds, while the exhaustive mode runs all individual rule checks before returning its report.
For example:
$ page document.pdf --profile ua1 --format details
Result : Non-conformant
Rules : 11 failed rules / 134 total
Checks : 24 failed checks
Profile : PDF/UA-1
Time : 0.147s
[PDFUA1-ALT-TEXT-LANGUAGE-001] [.........]
[PDFUA1-CONTENT-TAGGING-001] [.........]
[PDFUA1-FIGURE-ALTERNATIVE-TEXT-001] [.........]
[PDFUA1-HEADING-NESTING-001] [.........]
[PDFUA1-ID-PART-001] [.........]
[PDFUA1-ID-SCHEMA-001] [.........]
[PDFUA1-LINK-CONTENTS-001] [.........]
[PDFUA1-METADATA-TITLE-001] [.........]
[PDFUA1-SPAN-ACTUAL-TEXT-LANGUAGE-001] [.........]
[PDFUA1-TABLE-COLUMN-ROWSPAN-001] [.........]
[PDFUA1-TABLE-HEADERS-SCOPE-001] [.........]
[PDFUA1-TABLE-ROW-COLUMNSPAN-001] [.........]
[PDFUA1-TAGGED-DOCUMENT-001] [.........]
[PDFUA1-TEXT-LANGUAGE-001] [.........]
In the CLI, if you don't specify either --format details or --format json, the output is reduced and often much faster. Performance improvements can vary a lot depending on the document, but you can easily expect something between 2x and 10x most of the time.
Note
On a conformant document, lazy and exhaustive modes behave exactly the same.
If you use page from Rust, Python, or JavaScript, the lazy mode is used when calling is_pdf_compliant-like functions. validate_pdf-like functions will use exhaustive mode.