-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
forego caching cycles leads to a severe perf regression #60846
Copy link
Copy link
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemI-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemI-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Type
Fields
Give feedbackNo fields configured for issues without a type.
#60444 has introduced a severe perf regression when building/testing the
conch-runtimecrate.Previously a test run would take ~5 mins, and with the latest nightly (
rustc 1.36.0-nightly (372be4f36 2019-05-14)) it now takes ~82(!!) mins.$ git clone https://github.com/ipetkov/conch-runtime.git $ cd conch-runtime $ cargo test --lib # snip Finished dev [unoptimized + debuginfo] target(s) in 4m 16s $ cargo clean $ cargo +nightly test --lib # snip Finished dev [unoptimized + debuginfo] target(s) in 82m 54sCrate info
The crate offers the functionality to execute shell programs. Each piece of the grammar is represented as a node which can hold generic sub-nodes. The reasoning for this is so that the crate consumer could customize their AST with different/custom nodes, while reusing existing implementations.The shell grammar is deeply recursive. Basically each command can vary in complexity (compound commands such as
case,for, or simple commands likeecho foo), but is ultimately made up of a list of shell words (literals, interpolations, etc.). Because each word can contain a command substitution, the AST type is recursive (aCommand<W>has aWord<C>type, which gives usCommand<Word<Command<...>>).There are two "top-level" type definitions which seek to unify the entire AST tree concretely which are basically
TopLevelCommand(Command<TopLevelWord>)TopLevelWord(Word<TopLevelCommand>).The crate also heavily uses generics and trait bounds (perhaps overly so), however, there's hopefully some low hanging fruits that can reduce the 16x slow down in performance.
cc @nikomatsakis @pnkfelix