Skip to content

rustdoc produces gigantic on-disk content in modules with large number of numerical constants #100952

Open

Description

We have in Smithay some modules that define a large number of numerical constants (const u32), and this triggers a pathological edge-case in terms of documentation generation: rustdoc generates one 4.6 KB file for each of these constants.

For example see this module: https://smithay.github.io/smithay/smithay/wayland/seat/keysyms/index.html

It contains something like ~2400 numerical constants, as a result the documentation folder for this module alone is 20 MB. We have a few other instances of this in Smithay, and we realized that because of this our gh-pages branches is more than 99% of the size of the github repo (the total size of the target/doc folder for smithay and its public dependencies is around 220MB), and it significantly impacts clone and pull times for our contributors.

We're going to take steps to mitigate this on our side, but I suppose maybe something can be done on rustdoc side as well?

cc @GuillaumeGomez who asked me to make this issue.

edit:

Giving more details on this, more generally the issues lies with modules that contain a large number of un-documented items (like functions or constants), like the ones generated by gl_generator for example.

For such modules, rustdoc will create one file per item, with a constant 4.6KB overhead per file, while as a documentation reader this really does not bring anything useful given those pages do not contain any additional documentation beyond the symbol prototype.

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

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions