t: Filled out rest of test_traversal

There can always be more tests, but I think these give a nice set of
coverage over corner-cases in our traversal clobbering scheme.

These did find a couple bugs:

- If we clobber an inlined mroot, we need to adjust the mid by two
  mdirs, but only if there is no mtree/mdirs.

  To avoid this and other mid-related headaches, we just provide the new
  mid in lfsr_mdir_commit, since we always know it here.

- lfsr_mdir_commit compares mdirs by mptr, which means we need to
  clobber traversal's mdir's mptrs or else lfsr_mdir_commit will clobber
  already-clobbered traversals.

  There may be a better way to solve this, but it will probably get into
  the weeds with how lfsr_mdir_commit relies on mids vs mptrs...

Code changes:

           code          stack
  before: 34570           2624
  after:  34566 (-0.0%)   2624 (+0.0%)

Now that the dust has settled and we sort of know what the traversal
implementation will look like, we can look at the before and after to
get a rough idea of how much the traversal API actually costs:

                          code          stack
  no-traversal (before): 33886           2560
  yes-traversal (after): 34566 (+2.0%)   2624 (+2.5%)

Note this still includes the annoying lfsr_btree_traverse inlining stack
cost, which isn't really the traversal API's fault and may be avoidable
in the future.
This commit is contained in:
Christopher Haster
2024-06-18 21:18:40 -05:00
parent d36abd387d
commit 5b72973f8f
4 changed files with 1764 additions and 63 deletions
+2 -1
View File
@@ -3,7 +3,8 @@ after = [
'test_dirs',
'test_files',
'test_fwrite',
'test_forphans'
'test_forphans',
'test_traversal',
]
+1
View File
@@ -8,6 +8,7 @@ after = [
'test_dirs',
'test_files',
'test_forphans',
'test_traversal',
]
+1727 -21
View File
File diff suppressed because it is too large Load Diff