generated from prairir/project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IO buffering to encryptfile & decryptfile
Add IO buffering with bufio to encryptfile and decryptfile with a buffer size of 10KB. By default, golang IO operations arent buffered and so adding buffering is a key way to gain some performance. Obviously this doesnt work for everything. For imacry, im not 100% sure it will work. IO optimization is tricky. The reason we used a stream cypher and reading blocks 1KB at a time is not to hog memory and allow more concurrency, unfortunately this leads to possible unnecessary reads. Buffering IO can possibly get around part of that issue. Hopefully the buffer size of 10KB(or 10 blocks) can help cut down on that without hogging too much memory. The only real way to know for sure is extensive benchmarking which I probably will not do. Who knows, maybe I will in the future.
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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