Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long iterative compile times for cargo doc on workspaces with many crates #82845

Open
alice-i-cecile opened this issue Mar 6, 2021 · 10 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@alice-i-cecile
Copy link

I'm attempting to update the docs of Bevy, a relatively large Rust crate.

Building the docs using cargo doc initially takes about 90s. Rebuilding the docs using cargo doc without making any changes takes less than a second. Making any change to the doc strings within even a single file (e.g. Entity) seems to cause each subcrate to be redocumented, taking another 90s.

This obviously makes it quite challenging to check how my changes are displayed.

@jyn514
Copy link
Member

jyn514 commented Mar 6, 2021

@alice-i-cecile What version of rustdoc are you using? What is the output of cargo rustdoc -- -Z time-passes? Can you run cargo rustdoc -- -Z self-profile and upload the .mm_profdata file it generates?

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 6, 2021
@alice-i-cecile
Copy link
Author

How do I check the version of my rustdoc? cargo doc --version doesn't work, which is what I initially expected and cargo doc --help doesn't list any other suggestions.

@alice-i-cecile
Copy link
Author

Without changes:

C:\Users\Alice\Documents\GitHub\bevy [ecs-docs ↓1 +0 ~1 -0 !]> cargo rustdoc -- -Z time-passes
time:   0.000; rss:   17MB ->   17MB (   +0MB)  parse_crate
time:   0.000; rss:   17MB ->   17MB (   +0MB)  attributes_injection
time:   0.000; rss:   17MB ->   17MB (   +0MB)  recursion_limit
time:   0.000; rss:   18MB ->   18MB (   +0MB)  plugin_loading
time:   0.000; rss:   18MB ->   18MB (   +0MB)  plugin_registration
time:   0.000; rss:   18MB ->   18MB (   +0MB)  crate_injection
time:   0.076; rss:   18MB ->   26MB (   +8MB)  expand_crate
time:   0.000; rss:   26MB ->   26MB (   +0MB)  check_unused_macros
time:   0.076; rss:   18MB ->   26MB (   +8MB)  macro_expand_crate
time:   0.000; rss:   26MB ->   26MB (   +0MB)  maybe_building_test_harness
time:   0.000; rss:   26MB ->   26MB (   +0MB)  AST_validation
time:   0.000; rss:   26MB ->   26MB (   +0MB)  maybe_create_a_macro_crate
time:   0.001; rss:   26MB ->   27MB (   +0MB)  finalize_imports
time:   0.000; rss:   27MB ->   27MB (   +0MB)  finalize_macro_resolutions
time:   0.000; rss:   27MB ->   27MB (   +0MB)  late_resolve_crate
time:   0.000; rss:   27MB ->   27MB (   +0MB)  resolve_check_unused
time:   0.000; rss:   27MB ->   27MB (   +0MB)  resolve_report_errors
time:   0.000; rss:   27MB ->   27MB (   +0MB)  resolve_postprocess
time:   0.001; rss:   26MB ->   27MB (   +0MB)  resolve_crate
time:   0.000; rss:   27MB ->   27MB (   +0MB)  complete_gated_feature_checking
time:   0.077; rss:   18MB ->   27MB (   +9MB)  configure_and_expand
time:   0.000; rss:   27MB ->   27MB (   +0MB)  load_extern_crates
time:   0.000; rss:   27MB ->   27MB (   +0MB)  prepare_outputs
time:   0.000; rss:   27MB ->   27MB (   +0MB)  hir_lowering
time:   0.000; rss:   27MB ->   27MB (   +0MB)  early_lint_checks
time:   0.000; rss:   28MB ->   28MB (   +0MB)  setup_global_ctxt
time:   0.000; rss:   27MB ->   28MB (   +1MB)  create_global_ctxt
time:   0.000; rss:   28MB ->   29MB (   +1MB)  item_types_checking
time:   0.000; rss:   29MB ->   30MB (   +1MB)  crate_lints
time:   0.000; rss:   30MB ->   30MB (   +0MB)  module_lints
time:   0.000; rss:   29MB ->   30MB (   +1MB)  missing_docs
time:   0.000; rss:   30MB ->   30MB (   +0MB)  check_mod_attrs
time:   0.300; rss:  134MB ->  199MB (  +64MB)  clean_crate
time:   6.034; rss:  199MB ->  345MB ( +147MB)  collect_synthetic_impls
time:   0.003; rss:  345MB ->  346MB (   +0MB)  collect_items_for_trait_impls
time:   7.886; rss:  199MB ->  664MB ( +466MB)  collect-trait-impls
time:   0.031; rss:  664MB ->  643MB (  -21MB)  unindent-comments
time:   0.038; rss:  643MB ->  644MB (   +0MB)  check-private-items-doc-tests
time:   0.088; rss:  644MB ->  645MB (   +1MB)  strip-hidden
time:   0.056; rss:  645MB ->  645MB (   +0MB)  strip-private
time:   0.152; rss:  645MB ->  648MB (   +3MB)  collect-intra-doc-links
time:   0.077; rss:  648MB ->  648MB (   +0MB)  check-code-block-syntax
time:   0.018; rss:  648MB ->  648MB (   +0MB)  check-invalid-html-tags
time:   0.024; rss:  648MB ->  648MB (   +0MB)  propagate-doc-cfg
time:   0.019; rss:  648MB ->  649MB (   +1MB)  check-non-autolinks
time:   0.335; rss:  649MB ->  706MB (  +57MB)  create_format_cache
time:   9.162; rss:   28MB ->  706MB ( +678MB)  run_global_ctxt
time:   0.203; rss:  706MB ->  713MB (   +7MB)  create_renderer(html)
time:   0.002; rss:  714MB ->  714MB (   +0MB)  renderer_after_krate(html)
time:   2.793; rss:  706MB ->  504MB ( -203MB)  render_html
time:   0.075; rss:  504MB ->   87MB ( -417MB)  free_global_ctxt
    Finished dev [unoptimized + debuginfo] target(s) in 1.05s

With single file change:

C:\Users\Alice\Documents\GitHub\bevy [ecs-docs ↓1]> cargo rustdoc -- -Z time-passes
    Blocking waiting for file lock on build directory
    Checking bevy_ecs v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_ecs)
    Checking bevy_app v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_app)
    Checking bevy_log v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_log)
    Checking bevy_core v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_core)
    Checking bevy_transform v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_transform)
    Checking bevy_window v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_window)
    Checking bevy_input v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_input)
    Checking bevy_dynamic_plugin v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_dynamic_plugin)
    Checking bevy_winit v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_winit)
    Checking bevy_gilrs v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_gilrs)
    Checking bevy_diagnostic v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_diagnostic)
    Checking bevy_asset v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_asset)
    Checking bevy_render v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_render)
    Checking bevy_scene v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_scene)
    Checking bevy_audio v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_audio)
    Checking bevy_sprite v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_sprite)
    Checking bevy_pbr v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_pbr)
    Checking bevy_wgpu v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_wgpu)
    Checking bevy_gltf v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_gltf)
    Checking bevy_text v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_text)
    Checking bevy_ui v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_ui)
    Checking bevy_internal v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy\crates\bevy_internal)
 Documenting bevy v0.4.0 (C:\Users\Alice\Documents\GitHub\bevy)
time:   0.000; rss:   17MB ->   17MB (   +0MB)  parse_crate
time:   0.000; rss:   17MB ->   17MB (   +0MB)  attributes_injection
time:   0.000; rss:   17MB ->   17MB (   +0MB)  recursion_limit
time:   0.000; rss:   18MB ->   18MB (   +0MB)  plugin_loading
time:   0.000; rss:   18MB ->   18MB (   +0MB)  plugin_registration
time:   0.000; rss:   18MB ->   18MB (   +0MB)  crate_injection
time:   0.076; rss:   18MB ->   26MB (   +8MB)  expand_crate
time:   0.000; rss:   26MB ->   26MB (   +0MB)  check_unused_macros
time:   0.076; rss:   18MB ->   26MB (   +8MB)  macro_expand_crate
time:   0.000; rss:   26MB ->   26MB (   +0MB)  maybe_building_test_harness
time:   0.000; rss:   26MB ->   26MB (   +0MB)  AST_validation
time:   0.000; rss:   26MB ->   26MB (   +0MB)  maybe_create_a_macro_crate
time:   0.001; rss:   26MB ->   27MB (   +0MB)  finalize_imports
time:   0.000; rss:   27MB ->   27MB (   +0MB)  finalize_macro_resolutions
time:   0.000; rss:   27MB ->   27MB (   +0MB)  late_resolve_crate
time:   0.000; rss:   27MB ->   27MB (   +0MB)  resolve_check_unused
time:   0.000; rss:   27MB ->   27MB (   +0MB)  resolve_report_errors
time:   0.000; rss:   27MB ->   27MB (   +0MB)  resolve_postprocess
time:   0.001; rss:   26MB ->   27MB (   +0MB)  resolve_crate
time:   0.000; rss:   27MB ->   27MB (   +0MB)  complete_gated_feature_checking
time:   0.077; rss:   18MB ->   27MB (   +9MB)  configure_and_expand
time:   0.000; rss:   27MB ->   27MB (   +0MB)  load_extern_crates
time:   0.000; rss:   27MB ->   27MB (   +0MB)  prepare_outputs
time:   0.000; rss:   27MB ->   27MB (   +0MB)  hir_lowering
time:   0.000; rss:   27MB ->   27MB (   +0MB)  early_lint_checks
time:   0.000; rss:   28MB ->   28MB (   +0MB)  setup_global_ctxt
time:   0.000; rss:   27MB ->   28MB (   +1MB)  create_global_ctxt
time:   0.000; rss:   28MB ->   29MB (   +1MB)  item_types_checking
time:   0.000; rss:   29MB ->   30MB (   +1MB)  crate_lints
time:   0.000; rss:   30MB ->   30MB (   +0MB)  module_lints
time:   0.000; rss:   29MB ->   30MB (   +1MB)  missing_docs
time:   0.000; rss:   30MB ->   30MB (   +0MB)  check_mod_attrs
time:   0.300; rss:  134MB ->  199MB (  +64MB)  clean_crate
time:   6.034; rss:  199MB ->  345MB ( +147MB)  collect_synthetic_impls
time:   0.003; rss:  345MB ->  346MB (   +0MB)  collect_items_for_trait_impls
time:   7.886; rss:  199MB ->  664MB ( +466MB)  collect-trait-impls
time:   0.031; rss:  664MB ->  643MB (  -21MB)  unindent-comments
time:   0.088; rss:  644MB ->  645MB (   +1MB)  strip-hidden
time:   0.056; rss:  645MB ->  645MB (   +0MB)  strip-private
time:   0.152; rss:  645MB ->  648MB (   +3MB)  collect-intra-doc-links
time:   0.077; rss:  648MB ->  648MB (   +0MB)  check-code-block-syntax
time:   0.018; rss:  648MB ->  648MB (   +0MB)  check-invalid-html-tags
time:   0.024; rss:  648MB ->  648MB (   +0MB)  propagate-doc-cfg
time:   0.019; rss:  648MB ->  649MB (   +1MB)  check-non-autolinks
time:   0.335; rss:  649MB ->  706MB (  +57MB)  create_format_cache
time:   9.162; rss:   28MB ->  706MB ( +678MB)  run_global_ctxt
time:   0.203; rss:  706MB ->  713MB (   +7MB)  create_renderer(html)
time:   0.002; rss:  714MB ->  714MB (   +0MB)  renderer_after_krate(html)
time:   2.793; rss:  706MB ->  504MB ( -203MB)  render_html
time:   0.075; rss:  504MB ->   87MB ( -417MB)  free_global_ctxt
    Finished dev [unoptimized + debuginfo] target(s) in 25.59s

@alice-i-cecile
Copy link
Author

@jyn514 I've run the second command, but can't upload it here (even as a .zip) due to it being over 10 MB. Suggestions?

@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

@jyn514 I've run the second command, but can't upload it here (even as a .zip) due to it being over 10 MB. Suggestions?

Can you upload it to google drive or something? Or some other file hosting site?

With single file change:

Hmm, this seems to be missing almost two-thirds of the time (to be clear, this is a bug in time-passes, not your code). I'd need to see the self-profile output to see where the time is going I think.

@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

How do I check the version of my rustdoc?

rustdoc --version

@jyn514
Copy link
Member

jyn514 commented Mar 7, 2021

Ok, I didn't realize initially that by "project" you meant a workspace. Here's the times for a trivial change to entity:

> cargo doc -Z timings
    Checking bevy_ecs v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_ecs)
 Documenting bevy_ecs v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_ecs)
   Completed bevy_ecs v0.4.0 lib (doc) in 4.1s
   Completed bevy_ecs v0.4.0 lib (check) in 4.8s
    Checking bevy_app v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_app)
 Documenting bevy_app v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_app)
   Completed bevy_app v0.4.0 lib (check) in 0.7s
    Checking bevy_log v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_log)
    Checking bevy_core v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_core)
    Checking bevy_window v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_window)
   Completed bevy_log v0.4.0 lib (check) in 0.8s
    Checking bevy_transform v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_transform)
   Completed bevy_window v0.4.0 lib (check) in 1.0s
    Checking bevy_input v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_input)
   Completed bevy_core v0.4.0 lib (check) in 1.0s
    Checking bevy_dynamic_plugin v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_dynamic_plugin)
   Completed bevy_dynamic_plugin v0.4.0 lib (check) in 0.7s
    Checking bevy_diagnostic v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_diagnostic)
   Completed bevy_transform v0.4.0 lib (check) in 1.9s
   Completed bevy_diagnostic v0.4.0 lib (check) in 1.1s
    Checking bevy_asset v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_asset)
   Completed bevy_app v0.4.0 lib (doc) in 3.5s
 Documenting bevy_log v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_log)
 Documenting bevy_core v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_core)
   Completed bevy_input v0.4.0 lib (check) in 1.8s
 Documenting bevy_window v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_window)
   Completed bevy_asset v0.4.0 lib (check) in 3.9s
 Documenting bevy_transform v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_transform)
   Completed bevy_log v0.4.0 lib (doc) in 4.6s
 Documenting bevy_input v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_input)
   Completed bevy_core v0.4.0 lib (doc) in 5.7s
 Documenting bevy_dynamic_plugin v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_dynamic_plugin)
   Completed bevy_window v0.4.0 lib (doc) in 6.3s
    Checking bevy_winit v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_winit)
   Completed bevy_winit v0.4.0 lib (check) in 1.5s
    Checking bevy_gilrs v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_gilrs)
   Completed bevy_gilrs v0.4.0 lib (check) in 0.8s
    Checking bevy_render v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_render)
   Completed bevy_transform v0.4.0 lib (doc) in 6.0s
    Checking bevy_scene v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_scene)
   Completed bevy_dynamic_plugin v0.4.0 lib (doc) in 4.9s
    Checking bevy_audio v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_audio)
   Completed bevy_input v0.4.0 lib (doc) in 6.7s
 Documenting bevy_diagnostic v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_diagnostic)
   Completed bevy_scene v0.4.0 lib (check) in 2.1s
 Documenting bevy_winit v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_winit)
   Completed bevy_audio v0.4.0 lib (check) in 1.5s
 Documenting bevy_gilrs v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_gilrs)
   Completed bevy_diagnostic v0.4.0 lib (doc) in 4.8s
 Documenting bevy_asset v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_asset)
   Completed bevy_gilrs v0.4.0 lib (doc) in 5.0s
   Completed bevy_winit v0.4.0 lib (doc) in 5.9s
   Completed bevy_render v0.4.0 lib (check) in 11.6s
    Checking bevy_sprite v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_sprite)
    Checking bevy_pbr v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_pbr)
    Checking bevy_wgpu v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_wgpu)
   Completed bevy_asset v0.4.0 lib (doc) in 4.9s
 Documenting bevy_render v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_render)
   Completed bevy_pbr v0.4.0 lib (check) in 1.4s
 Documenting bevy_scene v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_scene)
   Completed bevy_sprite v0.4.0 lib (check) in 2.0s
 Documenting bevy_audio v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_audio)
   Completed bevy_wgpu v0.4.0 lib (check) in 2.8s
    Checking bevy_gltf v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_gltf)
   Completed bevy_gltf v0.4.0 lib (check) in 2.0s
    Checking bevy_text v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_text)
   Completed bevy_scene v0.4.0 lib (doc) in 5.1s
   Completed bevy_audio v0.4.0 lib (doc) in 5.2s
   Completed bevy_text v0.4.0 lib (check) in 2.7s
    Checking bevy_ui v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_ui)
   Completed bevy_ui v0.4.0 lib (check) in 2.5s
    Checking bevy_internal v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_internal)
   Completed bevy_internal v0.4.0 lib (check) in 0.5s
warning: unresolved link to `Features::STORAGE_TEXTURE_ACCESS_READ_WRITE`
  --> crates/bevy_render/src/texture/texture_descriptor.rs:61:10
   |
61 |     /// [`Features::STORAGE_TEXTURE_ACCESS_READ_WRITE`] must be enabled to use this access mode.
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `Features` in scope
   |
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `Features::STORAGE_TEXTURE_ACCESS_READ_WRITE`
  --> crates/bevy_render/src/texture/texture_descriptor.rs:61:10
   |
61 |     /// [`Features::STORAGE_TEXTURE_ACCESS_READ_WRITE`] must be enabled to use this access mode.
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `Features` in scope

warning: 2 warnings emitted

   Completed bevy_render v0.4.0 lib (doc) in 10.8s
 Documenting bevy_sprite v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_sprite)
 Documenting bevy_pbr v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_pbr)
 Documenting bevy_wgpu v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_wgpu)
   Completed bevy_sprite v0.4.0 lib (doc) in 5.3s
 Documenting bevy_text v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_text)
   Completed bevy_pbr v0.4.0 lib (doc) in 5.5s
 Documenting bevy_gltf v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_gltf)
   Completed bevy_wgpu v0.4.0 lib (doc) in 8.2s
   Completed bevy_text v0.4.0 lib (doc) in 4.2s
 Documenting bevy_ui v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_ui)
   Completed bevy_gltf v0.4.0 lib (doc) in 4.3s
   Completed bevy_ui v0.4.0 lib (doc) in 3.0s
 Documenting bevy_internal v0.4.0 (/home/joshua/src/rust/bevy/crates/bevy_internal)
   Completed bevy_internal v0.4.0 lib (doc) in 15.1s
 Documenting bevy v0.4.0 (/home/joshua/src/rust/bevy)
   Completed bevy v0.4.0 lib (doc) in 14.6s
      Timing report saved to /home/joshua/src/rust/bevy/cargo-timing-20210307T030310Z.html
    Finished dev [unoptimized + debuginfo] target(s) in 1m 23s

This will be a lot harder to fix - no individual crate takes too long (bevy_internal and bevy take the longest at around 15 seconds). I think it might help to work on startup times for individual crates - almost every crate seems to take at least 3 seconds, which seems awfully high.

@Mark-Simulacrum
Copy link
Member

FWIW a potentially faster fix in the meantime could be to pass -p for the specific crate you're editing the docs for, and just view those, which would avoid waiting for reverse dependencies to rebuild.

@jyn514 jyn514 changed the title Very long iterative compile times for cargo doc on large project Very long iterative compile times for cargo doc on workspaces with many crates Mar 7, 2021
@alice-i-cecile
Copy link
Author

Rustdoc version: rustdoc 1.52.0-nightly (45b3c28 2021-03-04)

Here's the .mm_profdata link after no changes made.

And the link after a one line change was made.

@camelid
Copy link
Member

camelid commented Mar 10, 2021

FWIW a potentially faster fix in the meantime could be to pass -p for the specific crate you're editing the docs for, and just view those, which would avoid waiting for reverse dependencies to rebuild.

And I think another way to do that is to cd into the crate's directory and then run cargo doc as normal.

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 22, 2021
Avoid temporary allocations in `render_assoc_item`

`render_assoc_item` came up as very hot in a profile of rustdoc on
`bevy`.  This avoids some temporary allocations just to calculate the
length of the header.

This should be a strict improvement, since all string formatting was
done twice before.

cc rust-lang#82845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants