-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore Concurrency (goroutines and channels) for Copying from Multiple Files #23
Comments
…tines and channels Added new package `cli/reader/reader.go` to handle file and stdin content reading using goroutines and channels. Includes `ReadContentConcurrently` function to improve performance when handling multiple files. Issue #23
Performance Comparison Review: Concurrency Improvement in ParseContent FunctionBenchmark ResultsWith Concurrency Improvement
Without Concurrency Improvement
AnalysisThe benchmarks demonstrate significant performance gains from the concurrency improvements introduced in PR #34. Here are the key findings:
Next Steps
ConclusionPR #34 successfully enhanced the |
… structure (#34) * feat(cli/reader): introduce `cli/reader/reader.go` package with goroutines and channels Added new package `cli/reader/reader.go` to handle file and stdin content reading using goroutines and channels. Includes `ReadContentConcurrently` function to improve performance when handling multiple files. Issue #23 * refactor(cli/clipper): refactor to use `cli/reader/reader.go` for content reading Refactored `cli/clipper/clipper.go` to utilize functionalities from `cli/reader/reader.go` package. This change improves code readability and separates concerns for content reading operations. * test(structure): restructure tests with `tests/tests.go` for helpers and constants Introduced `tests/tests.go` to hold helper functions and constants used across test cases, improving organization and reusability of testing resources. * test(reorganize): reorganize `tests/clipper/clipper_test.go` for `cli/clipper/clipper.go` tests Reorganized `tests/clipper/clipper_test.go` to focus exclusively on testing functionalities within `cli/clipper/clipper.go`, ensuring clear and specific test coverage. * test(add): implement `tests/reader/reader_test.go` for `cli/reader/reader.go` tests Introduced `tests/reader/reader_test.go` to contain tests exclusively targeting functionalities within `cli/reader/reader.go`. Enhances clarity and maintainability of test cases related to content reading operations.
When copying content from multiple files, clipper currently processes them sequentially. This might be inefficient, especially when dealing with a large number of files.
We should investigate the use of concurrency with goroutines and channels to parallelize the reading of content from multiple files. This could significantly speed up the copying process in such scenarios.
See:
Tasks:
The text was updated successfully, but these errors were encountered: