find_alive performance (matters a lot for unrecord)

[?]
Apr 29, 2021, 3:56 PM
AD6M434OFUCH6ISHP7GXSNNRBHEWP242ZDH7QCVCYLHMRASGE5MQC

Dependencies

  • [2] SFQBWL6P Improving unrecord performance (8 times faster on my tests)
  • [3] 3KHT2M5Z Fixing alive vertex detection in down contexts too
  • [4] I52XSRUH Massive cleanup, and simplification
  • [5] YN63NUZO Sanakirja 1.0
  • [6] WZVCLZKY address clippy lints
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] 6YMDOZIB Refactoring apply
  • [9] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [10] VO5OQW4W Removing anyhow in libpijul
  • [11] I24UEJQL Various post-fire fixes
  • [12] T7CAACFB Fixing zombie conflicts (some vertices were wrongly detected alive)

Change contents

  • replacement in libpijul/src/find_alive.rs at line 9
    [3.114985][3.134178:134264]()
    let mut stack = vec![SerializedEdge::empty(vertex0.start_pos(), ChangeId::ROOT)];
    [3.114985]
    [3.85243]
    let mut stack = vec![(SerializedEdge::empty(vertex0.start_pos(), ChangeId::ROOT), 0)];
  • replacement in libpijul/src/find_alive.rs at line 12
    [3.85325][3.763967:764007](),[3.763967][3.763967:764007]()
    while let Some(elt) = stack.pop() {
    [3.85325]
    [3.134265]
    while let Some((elt, len)) = stack.pop() {
  • edit in libpijul/src/find_alive.rs at line 28
    [3.134652][3.134652:134694]()
    && *vertex != vertex0
  • replacement in libpijul/src/find_alive.rs at line 30
    [3.764807][3.134756:134799](),[3.134799][3.764849:764923](),[3.764849][3.764849:764923]()
    alive.insert(*vertex);
    stack.truncate(elt_index);
    break;
    [3.764807]
    [3.764923]
    if *vertex == vertex0 {
    assert!(alive.is_empty());
    return Ok(alive)
    } else {
    alive.insert(*vertex);
    stack.truncate(elt_index);
    break;
    }
  • replacement in libpijul/src/find_alive.rs at line 42
    [3.765010][3.134800:134827]()
    stack.push(*v)
    [3.765010]
    [3.765103]
    stack.push((*v, len + 1))
  • replacement in libpijul/src/find_alive.rs at line 56
    [3.85366][2.0:93]()
    let mut stack = vec![(SerializedEdge::empty(vertex0.end_pos(), ChangeId::ROOT), false)];
    [3.85366]
    [3.85367]
    let mut stack = vec![SerializedEdge::empty(vertex0.end_pos(), ChangeId::ROOT)];
  • replacement in libpijul/src/find_alive.rs at line 59
    [2.95][2.95:331]()
    // `to_self` tells whether we've already marked a vertex alive
    // along the path from `vertex0`. This can happen if the only
    // vertices alive are from change `change`.
    while let Some((elt, mut to_self)) = stack.pop() {
    [2.95]
    [3.134913]
    while let Some(elt) = stack.pop() {
  • edit in libpijul/src/find_alive.rs at line 68
    [3.766007]
    [3.766007]
    debug!("stack = {:?}", stack);
  • replacement in libpijul/src/find_alive.rs at line 74
    [3.15838][3.766233:766283](),[3.64879][3.766233:766283](),[3.115289][3.766233:766283](),[3.766233][3.766233:766283]()
    debug!("find_alive_up: v = {:?}", v);
    [3.115289]
    [3.135056]
    debug!("find_alive_up: v = {:?} change = {:?}", v, change);
  • replacement in libpijul/src/find_alive.rs at line 88
    [3.115464][3.16202:16235](),[3.16202][3.16202:16235]()
    if is_file {
    [3.115464]
    [3.5472]
    if is_file && vertex != vertex0 {
  • replacement in libpijul/src/find_alive.rs at line 94
    [3.767445][3.135385:135438](),[3.135438][2.332:378](),[2.378][3.16362:16444](),[3.135438][3.16362:16444](),[3.16362][3.16362:16444](),[3.16444][2.379:420]()
    if v.introduced_by() != change {
    alive.insert(vertex);
    stack.truncate(elt_index);
    break;
    } else if !to_self {
    [3.69]
    [2.420]
    if vertex != vertex0 {
  • edit in libpijul/src/find_alive.rs at line 96
    [2.466][2.466:506]()
    to_self = true;
  • edit in libpijul/src/find_alive.rs at line 97
    [3.16466]
    [3.767445]
    stack.truncate(elt_index);
    stack.truncate(elt_index);
    break;
  • replacement in libpijul/src/find_alive.rs at line 103
    [3.135477][3.16503:16532](),[3.16503][3.16503:16532]()
    if is_file {
    [3.135477]
    [3.16532]
    if is_file && vertex != vertex0 {
  • replacement in libpijul/src/find_alive.rs at line 109
    [3.768674][2.507:549]()
    stack.push((*v, to_self))
    [3.768674]
    [3.768704]
    stack.push(*v)