Repository navigation
perf(who): look up each T3 thread directory's checkout once - #125
Merged
Merged
Conversation
`swarmail who` spawned git for every running T3 thread that was not in the roster, although the threads share far fewer directories. With about 800 running threads in 149 directories it took 1.6 s, 94% of it in git spawns. It now asks once per directory and takes 0.3 s with the same 82 rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
swarmail whorangit rev-parsefor every running T3 thread that was not in the roster. Those threads share far fewer directories than there are threads: on this machine 793 running threads use 149 directories.whoRowsnow remembers the answer per directory for the length of one call.Measured with
hyperfine-style wall time on the same machine and T3 state:swarmail who --jsonA CPU profile of the old command put 94% of its time in
spawnSyncfor git. The new test fails without the change (git is asked four times for two directories) and passes with it.bun run checkand the full suite (1215 pass, 0 fail) pass.Behavior is unchanged except for one case: if a directory's checkout changes while a single
whocall runs, the call keeps the first answer.Summary by CodeRabbit
swarmail whonow checks Git once per distinct running T3 thread directory, reducing repeated checks. A recorded example improved from 1.6 seconds to 0.3 seconds.