Parallelize health checks in dream status for 5-10x speedup#101
Closed
bugman-007 wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Closed
Parallelize health checks in dream status for 5-10x speedup#101bugman-007 wants to merge 1 commit intoLight-Heart-Labs:mainfrom
bugman-007 wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Conversation
Problem: - Health checks ran sequentially, taking ~13-17 seconds for 13+ services - Each curl call blocked until completion (~1 second per service) - Users experienced noticeable lag on every 'dream status' invocation Solution: - Launch all health checks as background jobs simultaneously - Wait for all to complete, then display results in SERVICE_IDS order - Added 5-second timeout protection to prevent hanging - Temp directory with trap ensures cleanup on function return Performance Impact: - Before: 13-17 seconds (sequential) - After: 1-2 seconds (parallel) - Speedup: 5-10x faster Implementation Details: - Uses bash background jobs (&) and wait builtin - Results stored in temp files, read back in original order - Preserves exact output format and behavior - Error handling for failed background jobs - No new dependencies or breaking changes Testing: - Added test-parallel-health-checks.sh: validates syntax, cleanup, ordering - Added benchmark-status-performance.sh: measures actual speedup - All tests pass, syntax validated with bash -n Files Changed: - dream-cli: Replaced sequential loop (lines 126-155) with parallel impl - tests/test-parallel-health-checks.sh: New test suite (7 tests) - tests/benchmark-status-performance.sh: New performance benchmark
Collaborator
|
This was merged in PR #93 my friend. Thanks again! It was a really smart fix! Added you to our acknowledgements section as well! |
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.
Problem:
Solution:
Performance Impact:
Implementation Details:
Testing:
Files Changed: