upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/thread_stacks.cpp
diff options
context:
space:
mode:
authorAmine El Mahouti <amine.elmahouti23@gmaiL.com>2026-11-26 01:00:34 +0100
committerenlight3d <19186686+enlight3d@users.noreply.github.com>2026-11-26 17:27:39 +0100
commite6b97d1e436d0102aa512ac67f43db44c2fb75ef (patch)
tree75815ebfc3957cc049669acac894e8db5bf1df04 /runtime/src/thread_stacks.cpp
parent2e2c51c0929cae8195366e52adfef17156a355d2 (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 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions