You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
proxy() passed the readonly and shallow flags as keyword arguments to
proxy_db.get_proxy, the proxy classes and its own tuple recursion;
keyword calls are measurably slower than positional ones, and this is
the hottest code path in observ (it runs on the result of every read
from a proxied container).
The readonly proxy classes' __init__ shims now line up with
Proxy.__init__ ((target, readonly, shallow)) so that proxy() can
construct any proxy type positionally. The readonly argument is
accepted and ignored, so a directly constructed Readonly* proxy is
still always readonly (previously enforced with two dict merges per
construction, which are gone now).
New tests pin down that positional and keyword flags resolve to the
same cached proxies, and that direct Readonly* construction still
forces readonly and honors shallow.
Measured on bench/test_creation.py: proxy creation ~6-12% faster.
Claude-Session: https://claude.ai/code/session_01UyALuqgF1ZZ3Lj88FzwGVc
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments