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

Remove NodeState::{Waiting,Done} #66405

Merged
merged 5 commits into from
Dec 13, 2019

Commits on Dec 12, 2019

  1. Remove NodeState::{Waiting,Done}.

    `NodeState` has two states, `Success` and `Done`, that are only used
    within `ObligationForest` methods. This commit removes them, and renames
    the existing `Waiting` state as `Success`.
    
    We are left with three states: `Pending`, `Success`, and `Error`.
    `Success` is augmented with a new `WaitingState`, which indicates when
    (if ever) it was last waiting on one or more `Pending` nodes. This
    notion of "when" requires adding a "process generation" to
    `ObligationForest`; it is incremented on each call to
    `process_obligtions`.
    
    This commit is a performance win.
    
    - Most of the benefit comes from `mark_as_waiting` (which the commit
      renames as `mark_still_waiting_nodes`). This function used to do two
      things: (a) change all `Waiting` nodes to `Success`, and (b) mark all
      nodes that depend on a pending node as `Waiting`. In practice, many
      nodes went from `Waiting` to `Success` and then immediately back to
      `Waiting`. The use of generations lets us skip step (a).
    
    - A smaller benefit comes from not having to change nodes to the `Done`
      state in `process_cycles`.
    nnethercote committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    a8207b1 View commit details
    Browse the repository at this point in the history
  2. Move functions around.

    In particular, it has bugged me for some time that `process_cycles` is
    currently located before `mark_still_waiting_nodes` despite being called
    afterwards.
    nnethercote committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    7d55044 View commit details
    Browse the repository at this point in the history
  3. Remove some debug! statements.

    Because I am tired of looking at them.
    nnethercote committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    4ec87d5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    76916d7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cb21293 View commit details
    Browse the repository at this point in the history