diff options
| author | Amine El Mahouti <amine.elmahouti23@gmaiL.com> | 2026-11-26 01:00:34 +0100 |
|---|---|---|
| committer | enlight3d <19186686+enlight3d@users.noreply.github.com> | 2026-11-26 17:27:39 +0100 |
| commit | e6b97d1e436d0102aa512ac67f43db44c2fb75ef (patch) | |
| tree | 75815ebfc3957cc049669acac894e8db5bf1df04 /tests/test_run_gpu_tests_python_assembler.py | |
| parent | 2e2c51c0929cae8195366e52adfef17156a355d2 (diff) | |
d16_format_probe: compute the rule models once per input
models16() and models32() are pure functions of (kind, bits, value), but a
sweep, classify() and the tests ask for the same 16-bit values many times:
about 955,000 calls for 131,000 inputs in tests/test_d16_format_probe.py.
Cache the exact arithmetic per input (as tuples, a third of a dict's
memory) and hand each caller a fresh dict, so an edit cannot reach the
cache. Same bits for every input of every format.
tests/test_d16_format_probe.py: 26.7 s -> 7.7 s; tests/test_d16_image_probe.py
(which uses the same models): 21.8 s -> 13.1 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_run_gpu_tests_python_assembler.py')
0 files changed, 0 insertions, 0 deletions