Files
Nim/lib/std
Juan Carlos a38e3dcb1f 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>
2023-09-30 06:31:28 +02:00
..
2021-02-21 19:53:28 -08:00
2023-01-02 10:39:17 +01:00
2023-01-02 10:39:17 +01:00
2022-11-28 15:15:44 -05:00
2021-03-10 10:39:23 -08:00
2021-02-21 19:53:28 -08:00
2023-01-02 10:39:17 +01:00
2021-10-01 13:57:06 +02:00
2021-02-21 19:53:28 -08:00
2023-06-08 22:52:24 +08:00