aboutsummaryrefslogtreecommitdiff
path: root/scripts/benchmark.py
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2020-12-20 13:45:09 +0000
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-12-20 13:52:27 +0000
commit050da302b8048f8ebf5f8a2f83ea302c7f954669 (patch)
tree5088dd0e5e6a49cb7859e2c1c7cd9769dcc1f71e /scripts/benchmark.py
parentrender: fix rounding error when calculating background color with alpha (diff)
generate-alt-random-writes: use python random, allow setting a seed
Using Python's own PRNG should make the code cleaner and allow for reproducible stimulus files if that is desired via setting --seed (at least for the same versions of the script, changing the kind and/or order of the random calls will of course impact the output in the future). I did the following substitutions: * rand.read(1)[0] % n and struct.unpack('@H', rand.read(2))[0] % n → random.randrange(n) * rand.read(1)[0] → random.randrange(256) * rand.read(n) → [random.randrange(256) for _ in range(n)] (better alternative would have been random.randbytes(n), but is only available for Python >= 3.9, switching to this in the future will impact output) * list[rand.read(1) % len(list)] → random.choice(list)
Diffstat (limited to 'scripts/benchmark.py')
0 files changed, 0 insertions, 0 deletions