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.