Background
Tectonic, like classical LaTeX, runs multiple passes over a document
when it has cross-references, bibliography, or tables of contents.
Each pass reads a .aux file written by the previous pass.
Bazel currently caches the action output (the PDF + synctex). It
does not separately cache the intermediate .aux / .toc / .bbl
files between passes within a single action — Tectonic does that
internally in its temp dir.
The hypothesis is: for multi-pass documents with stable
bibliographies, we might be able to skip a pass by caching the
.aux file as a Bazel action output of an earlier action, and
feeding it back as an input to a later one.
Why this is probably never worth doing
- Tectonic is fast. A full from-scratch compile of a thesis-sized
document with biblatex + biber is ~3-5 seconds.
- Bazel's action-output caching already kicks in for the
no-source-change case: rebuild is ~0.05s, dominated by Bazel
overhead.
- The savings would only materialise when a user edits a
non-bibliography source file in a way that changes the body but
not the citations — a real but narrow case.
What "done" looks like
Either:
- A benchmark that demonstrates an actually-painful slowdown on a
real document, with a sketch of a fix.
- A documented benchmark showing the savings are negligible, with
this issue closed.
Source: DESIGN.md §5.5.
Background
Tectonic, like classical LaTeX, runs multiple passes over a document
when it has cross-references, bibliography, or tables of contents.
Each pass reads a
.auxfile written by the previous pass.Bazel currently caches the action output (the PDF + synctex). It
does not separately cache the intermediate
.aux/.toc/.bblfiles between passes within a single action — Tectonic does that
internally in its temp dir.
The hypothesis is: for multi-pass documents with stable
bibliographies, we might be able to skip a pass by caching the
.auxfile as a Bazel action output of an earlier action, andfeeding it back as an input to a later one.
Why this is probably never worth doing
document with biblatex + biber is ~3-5 seconds.
no-source-change case: rebuild is ~0.05s, dominated by Bazel
overhead.
non-bibliography source file in a way that changes the body but
not the citations — a real but narrow case.
What "done" looks like
Either:
real document, with a sketch of a fix.
this issue closed.
Source: DESIGN.md §5.5.