supitsdu / clipper

Seamlessly copy file contents to clipboard from command line. Lightweight, cross-platform tool for instant text transfers.
MIT License
3 stars 3 forks source link

feat: improve performance with buffered I/O (bufio) for large file handling #33

Closed supitsdu closed 4 months ago

supitsdu commented 4 months ago

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:

Tasks:

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

ccoVeille commented 4 months ago

Either here or in #22, it would be interesting to provide a benchmark

You could use Go native benchmark

supitsdu commented 4 months ago

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.

supitsdu commented 4 months ago

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.

ccoVeille commented 4 months ago

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.