summary refs log tree commit diff stats
path: root/lib/system/orc.nim
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2023-09-30 01:31:28 -0300
committerGitHub <noreply@github.com>2023-09-30 06:31:28 +0200
commita38e3dcb1f0c47b89f07b343a259c4b10a333ac9 (patch)
tree46a51136d0afb9bac3c50cf4ed2b63bb973f6b54 /lib/system/orc.nim
parent5eeafbf55029816e5022d9d6aa9ed3b0acf2d3ba (diff)
downloadNim-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 'lib/system/orc.nim')
0 files changed, 0 insertions, 0 deletions
f='#n127'>127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215