Improving unrecord performance (8 times faster on my tests)

[?]
Apr 28, 2021, 8:14 PM
SFQBWL6PHSX7MQVOSQW4ZO35SLXNHN6562IWYCN4UKWAEVE6AQNQC

Dependencies

  • [2] I24UEJQL Various post-fire fixes
  • [3] T7CAACFB Fixing zombie conflicts (some vertices were wrongly detected alive)
  • [4] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [5] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [6] 6YMDOZIB Refactoring apply
  • [7] VO5OQW4W Removing anyhow in libpijul
  • [8] YN63NUZO Sanakirja 1.0

Change contents

  • replacement in libpijul/src/find_alive.rs at line 52
    [2.85366][4.134828:134912](),[4.765422][4.134828:134912]()
    let mut stack = vec![SerializedEdge::empty(vertex0.end_pos(), ChangeId::ROOT)];
    [2.85366]
    [2.85367]
    let mut stack = vec![(SerializedEdge::empty(vertex0.end_pos(), ChangeId::ROOT), false)];
  • replacement in libpijul/src/find_alive.rs at line 54
    [2.85409][4.765697:765737](),[4.765697][4.765697:765737]()
    while let Some(elt) = stack.pop() {
    [2.85409]
    [4.134913]
    // `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() {
  • edit in libpijul/src/find_alive.rs at line 92
    [3.69][4.767403:767445](),[4.767403][4.767403:767445]()
    alive.insert(vertex);
  • edit in libpijul/src/find_alive.rs at line 93
    [4.135438]
    [4.16362]
    alive.insert(vertex);
  • edit in libpijul/src/find_alive.rs at line 96
    [4.16444]
    [4.16444]
    } else if !to_self {
    alive.insert(vertex);
    to_self = true;
  • replacement in libpijul/src/find_alive.rs at line 109
    [4.768674][4.135478:135509]()
    stack.push(*v)
    [4.768674]
    [4.768704]
    stack.push((*v, to_self))