Quadratic (or worse) compile time with extremely borrowed type · Issue #103421 · rust-lang/rust (original) (raw)
This pattern compiles faster now that #103214 has merged, but it's still slower than I'd like.
fn f( _: &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&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|
Seems worse than quadratic but better than cubic.
Which passes are slow
Over half the time is in MIR_borrow_checking
, with wf_checking
and type_check_crate
also contributing substantially.
Output with -Z time-passes (4000x reference type; 85 seconds)
time: 0.004; rss: 21MB -> 27MB ( +6MB) parse_crate
time: 0.000; rss: 27MB -> 27MB ( +0MB) attributes_injection
time: 0.000; rss: 27MB -> 27MB ( +0MB) plugin_loading
time: 0.000; rss: 27MB -> 27MB ( +0MB) crate_injection
time: 0.007; rss: 27MB -> 31MB ( +4MB) expand_crate
time: 0.007; rss: 27MB -> 31MB ( +4MB) macro_expand_crate
time: 0.000; rss: 31MB -> 31MB ( +0MB) maybe_building_test_harness
time: 0.000; rss: 31MB -> 32MB ( +0MB) AST_validation
time: 0.000; rss: 32MB -> 32MB ( +0MB) maybe_create_a_macro_crate
time: 0.000; rss: 32MB -> 32MB ( +0MB) finalize_imports
time: 0.000; rss: 32MB -> 32MB ( +0MB) resolve_access_levels
time: 0.000; rss: 32MB -> 32MB ( +1MB) finalize_macro_resolutions
time: 0.003; rss: 32MB -> 35MB ( +3MB) late_resolve_crate
time: 0.000; rss: 35MB -> 35MB ( +0MB) resolve_check_unused
time: 0.000; rss: 35MB -> 35MB ( +0MB) resolve_report_errors
time: 0.000; rss: 35MB -> 35MB ( +0MB) resolve_postprocess
time: 0.004; rss: 32MB -> 35MB ( +3MB) resolve_crate
time: 0.000; rss: 35MB -> 35MB ( +0MB) complete_gated_feature_checking
time: 0.001; rss: 35MB -> 35MB ( +0MB) early_lint_checks
time: 0.012; rss: 27MB -> 35MB ( +8MB) configure_and_expand
time: 0.000; rss: 35MB -> 35MB ( +0MB) prepare_outputs
time: 0.000; rss: 35MB -> 35MB ( +0MB) setup_global_ctxt
time: 0.000; rss: 38MB -> 38MB ( +0MB) drop_ast
time: 0.008; rss: 36MB -> 39MB ( +3MB) looking_for_entry_point
time: 0.000; rss: 39MB -> 39MB ( +0MB) looking_for_derive_registrar
time: 0.000; rss: 39MB -> 39MB ( +0MB) unused_lib_feature_checking
time: 0.012; rss: 36MB -> 39MB ( +4MB) misc_checking_1
time: 0.084; rss: 39MB -> 40MB ( +1MB) type_collecting
time: 0.000; rss: 40MB -> 40MB ( +0MB) impl_wf_inference
time: 0.000; rss: 40MB -> 40MB ( +0MB) coherence_checking
time: 11.434; rss: 40MB -> 1059MB (+1019MB) wf_checking
time: 0.000; rss: 1059MB -> 1059MB ( +0MB) item_types_checking
time: 0.536; rss: 1059MB -> 1064MB ( +5MB) item_bodies_checking
time: 12.053; rss: 39MB -> 1064MB (+1025MB) type_check_crate
time: 0.000; rss: 1064MB -> 1064MB ( +0MB) match_checking
time: 0.000; rss: 1064MB -> 1064MB ( +0MB) liveness_checking
time: 0.001; rss: 1064MB -> 1064MB ( +0MB) misc_checking_2
time: 66.787; rss: 1064MB -> 32MB (-1032MB) MIR_borrow_checking
time: 0.000; rss: 32MB -> 32MB ( +0MB) MIR_effect_checking
time: 0.000; rss: 32MB -> 32MB ( +0MB) layout_testing
time: 0.005; rss: 34MB -> 35MB ( +0MB) crate_lints
time: 0.407; rss: 35MB -> 35MB ( +1MB) module_lints
time: 0.412; rss: 34MB -> 35MB ( +1MB) lint_checking
time: 5.724; rss: 35MB -> 95MB ( +60MB) privacy_checking_modules
time: 0.000; rss: 95MB -> 95MB ( +0MB) check_lint_expectations
time: 6.142; rss: 32MB -> 95MB ( +63MB) misc_checking_3
time: 0.002; rss: 95MB -> 95MB ( +0MB) monomorphization_collector_root_collections
time: 0.049; rss: 95MB -> 107MB ( +12MB) monomorphization_collector_graph_walk
time: 0.004; rss: 107MB -> 108MB ( +1MB) partition_and_assert_distinct_symbols
time: 0.001; rss: 109MB -> 109MB ( +0MB) write_allocator_module
time: 0.000; rss: 109MB -> 109MB ( +0MB) find_cgu_reuse
time: 0.119; rss: 109MB -> 183MB ( +73MB) codegen_to_LLVM_IR
time: 0.190; rss: 95MB -> 183MB ( +88MB) codegen_crate
time: 0.000; rss: 183MB -> 183MB ( +0MB) serialize_dep_graph
time: 0.170; rss: 113MB -> 115MB ( +3MB) LLVM_passes
time: 0.273; rss: 183MB -> 54MB ( -129MB) free_global_ctxt
time: 0.000; rss: 54MB -> 54MB ( +0MB) join_worker_thread
time: 0.000; rss: 54MB -> 54MB ( +0MB) finish_ongoing_codegen
time: 0.000; rss: 54MB -> 54MB ( +0MB) serialize_work_products
time: 0.132; rss: 54MB -> 54MB ( +0MB) run_linker
time: 0.001; rss: 54MB -> 54MB ( +0MB) link_binary_remove_temps
time: 0.135; rss: 54MB -> 54MB ( +1MB) link_binary
time: 0.135; rss: 54MB -> 54MB ( +1MB) link_crate
time: 0.135; rss: 54MB -> 54MB ( +1MB) link
time: 85.626; rss: 12MB -> 39MB ( +27MB) total
Impact on my fuzzing
Low. While compile time is quadratic, the constant factor is small. The fuzzer usually keeps inputs under 4096 total bytes. I can skip fuzz-generated testcases that have over 400 ampersand characters without losing much coverage.
Limits
Should there be a limit on levels of nesting &
in types and expressions? Maybe the recursion_limit crate attribute should apply.
Meta
rustc --version --verbose
:
rustc 1.66.0-nightly (dcb376115 2022-10-20)
binary: rustc
commit-hash: dcb376115066d111dbf5f13d5ac2a2dbe8c12add
commit-date: 2022-10-20
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2
@rustbot label +I-compiletime