Extend ScanBenchmark report with per-phase durations#83
Merged
Conversation
Add enumerateDuration, verifyDuration, and persistDuration fields to ScanBenchmarkReport so the benchmark executable and tests surface where the time goes during a scan. Mirrors the P1 signpost phases: enumerate (recursive walk + concurrentPerform), verify (duplicate hashing), and persist (hashCache.persist + on-disk writes). - StorageScan gains enumerateDuration (time from startedAt to the duplicate verification start). duplicateVerificationDuration is retained for backward compat and mirrored as verifyDuration on the report. - ScanBenchmarkRunner can now hold a DuplicateHashCache and times the persist() call against it. Default behavior (no cache) keeps persistDuration at 0 so the existing benchmark path is unchanged. - totalDuration is a computed property summing the three phases so quick comparisons against the existing aggregate duration are easy. - Two new tests assert the field surfaces, the alias semantics, the cache-hit re-scan timing, and that the on-disk cache file lands at the expected cache URL. Co-Authored-By: NCode <noreply@noumena.com>
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.
Summary
enumerateDuration,verifyDuration, andpersistDurationtoScanBenchmarkReport, mirroring the P1 signpost phases (enumerate / verify / persist).StorageScannow tracksenumerateDuration(startedAt → duplicate-verification start);duplicateVerificationDurationis kept for backward compatibility and surfaced asverifyDurationon the report.ScanBenchmarkRunneraccepts an optionalDuplicateHashCache, drivespersist()after the scan, and times it intopersistDuration. Default behavior (no cache) leavespersistDurationat 0 so the existing benchmark path is unchanged.totalDurationcomputed property enumerating the sum of the three phases.P4 of the v0.5.0 Performance Upgrade.
Test plan
swift buildswift test(56 tests, including the 2 new benchmark tests)./script/public_upload_audit.shStorageScopeBenchmark --syntheticand confirm the newEnumerate/Verify/Persist/Phase totallines print.🤖 Generated with Code