Dr. Juande Santander-Vela on Nostr: nprofile1q…w7fmf thanks for this! A couple of updates: * On `zsh`, `time` is a ...
nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqg8j7htndnmhy465czcvpevlsjz376yhtnvz6y6809g6v9qfa7wqq3w7fmf (nprofile…7fmf) thanks for this! A couple of updates:
* On `zsh`, `time` is a builtin, and does not have `-l` or `-h` options. You need to use `/usr/bin/time` instead.
* I've run both versions, and used `ksdiff` with the outputs:
* the memory usage of the array versions the loop version is 2:1 in the 1_000_000 tries, and 10:1 in the 10_000_000, so unless you're memory constrained it is worth using it.
* the relative time use is 16 times faster for the array versus loop version on the 10_000_000 tries, and 10 tunes faster for the 1_000_000 tries.
* with a smaller set (100_000 tries), the relative speed up is 4 times, and relative size is practically the same (just 3% difference).
All this (no pun intended) on a M1 Pro with 16 GB RAM.
* On `zsh`, `time` is a builtin, and does not have `-l` or `-h` options. You need to use `/usr/bin/time` instead.
* I've run both versions, and used `ksdiff` with the outputs:
* the memory usage of the array versions the loop version is 2:1 in the 1_000_000 tries, and 10:1 in the 10_000_000, so unless you're memory constrained it is worth using it.
* the relative time use is 16 times faster for the array versus loop version on the 10_000_000 tries, and 10 tunes faster for the 1_000_000 tries.
* with a smaller set (100_000 tries), the relative speed up is 4 times, and relative size is practically the same (just 3% difference).
All this (no pun intended) on a M1 Pro with 16 GB RAM.