Skip to content

Precompile workload slows loading of every dependent package #313

Closed

Description

@MichaelHatherly

The precompile workload added in #309 (released in 0.10.1) makes every package that depends on DocStringExtensions slower to precompile and load. It shows up as the TTFX regression discussed in JuliaLang/julia#63813.

Measured on Julia nightly with ForwardDiff, whose manifest is otherwise identical across versions:

0.9.5 0.10.0 0.10.1
precompile ForwardDiff stack 10.0 s 10.7 s 13.3 s
DocStringExtensions load (@time_imports) 3 ms 4 ms 33 ms
cached specializations in the image 18 223 4,441
first render of four docstrings (Docs.doc) 0.4 s 1.0 s 0.1 s

Loading DocStringExtensions alone causes no invalidations. About 75% of the 0.10.1 load goes to insert_backedges verifying the edges of the cached code, mostly specializations of Base methods such as iterate, getproperty and getindex.

Removing the workload gives back the load time, but the first render then takes about 1 s. The aim is a smaller workload, or code that compiles to fewer specializations, so that load time drops back towards 0.10.0's and the first render stays fast.

Activity

  1. MichaelHatherly commented on Oct 21, 2026

    @MichaelHatherly
    MemberAuthor

    fyi @JamesWrigley. I'm currently looking into a better balance for the precompiles so this doesn't cause such a problem for load times.

    When measuring #309 did you have a specific measuring harness you could share, or was it just measuring time in: "For CImGui.jl this cut ~12s off building the docs."? If the former could you share that here, if the latter then I'll just ask you to try out the PR once it is in shape.

  2. JamesWrigley commented on Oct 21, 2026

    @JamesWrigley
    Contributor

    Ah, sorry about that. Yeah it was literally just building the CImGui.jl docs, no custom benchmark.

  3. MichaelHatherly commented on Oct 21, 2026

    @MichaelHatherly
    MemberAuthor

    No worries at all, I'll put that measurement in as well and see if we can avoid adding too much time there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions