Closed supitsdu closed 4 months ago
Either here or in #22, it would be interesting to provide a benchmark
You could use Go native benchmark
Either here or in #22, it would be interesting to provide a benchmark
You could use Go native benchmark
I'm working on it using testing.B
. Later I'll add the results and reasoning behind the decision to either add this PR or close it.
After extensive benchmarking, I have concluded that the non-buffered implementation provides superior performance.
Find the detailed Clipper Performance Evaluation of Buffered I/O Implementation report here.
Based on these findings, I will close this PR.
It's always a good thing to do benchmarking and a great things to publish the results.
Especially because, you can find them back later with search, and copy paste to run them again if there is a need to compare again.
This pull request addresses issue #22 by improving the performance of reading contents (e.g., file nor stdin) in Clipper using buffered I/O (
bufio
).Changes:
Refactor: Implement buffered I/O for reading content
bufio.Reader
to handle large sums of data efficiently.ReadContent
function.Test: Add unit tests for
ReadContent
functiont.Run
for better readability.Tasks:
bufio.Reader
ReadContent
functionReadContent
t.Run
These changes were an attempt to enhance the performance of Clipper, especially when dealing with large files. However, based on the benchmark results, the non-buffered I/O implementation remains the better option for Clipper's performance needs.
Reference