diff options
author | Juan Carlos <juancarlospaco@gmail.com> | 2023-09-30 01:31:28 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-30 06:31:28 +0200 |
commit | a38e3dcb1f0c47b89f07b343a259c4b10a333ac9 (patch) | |
tree | 46a51136d0afb9bac3c50cf4ed2b63bb973f6b54 /changelog.md | |
parent | 5eeafbf55029816e5022d9d6aa9ed3b0acf2d3ba (diff) | |
download | Nim-a38e3dcb1f0c47b89f07b343a259c4b10a333ac9.tar.gz |
copyFile with bufferSize instead of hardcoded value (#22769)
- `copyFile` allows to specify `bufferSize` instead of hardcoded wrong value. Tiny diff. # Performance - 1200% Performance improvement. # Check it yourself Execute: ```bash for i in $(seq 0 10); do bs=$((1024*2**$i)) printf "%7s Kb\t" $bs timeout --foreground -sINT 2 dd bs=$bs if=/dev/zero of=/dev/null 2>&1 | sed -n 's/.* \([0-9.,]* [GM]B\/s\)/\1/p' done ``` (This script can be ported to PowerShell for Windows I guess, it works in Windows MinGW Bash anyways). # Stats - Hardcoded `8192` or `8000` Kb bufferSize gives `5` GB/s. - Setting `262144` Kb bufferSize gives `65` GB/s (script suggestion). --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'changelog.md')
-rw-r--r-- | changelog.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 74020e8fa..1fb6377a2 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ [//]: # "Changes:" +- Changed `std/osfiles.copyFile` to allow to specify `bufferSize` instead of a hardcoded one. [//]: # "Additions:" |