pyvider 2026-03-21
Cache Protobuf Schema Conversions by Identity
26 files · 1,366+ · 1,365-

Cache Protobuf Schema Conversions by Identity

26 files changed
  • schema_adapter.py Updated schema_adapter.py (+28/-4 lines)
  • baselines.json Updated baselines.json (+3/-3 lines)
  • ci.yml Updated ci.yml (+3/-3 lines)
  • .gitignore Added .gitignore (+6 lines)
  • VERSION Updated VERSION (+1/-1 lines)
  • pyproject.toml Updated pyproject.toml (+2/-1 lines)
  • availability.py Updated availability.py (+1/-1 lines)
  • decorators.py Updated decorators.py (+2/-1 lines)
  • decorators.py Updated decorators.py (+1/-1 lines)
  • adapters.py Updated adapters.py (+3/-1 lines)
  • handler.py Updated handler.py (+1/-1 lines)
  • discovery.py Updated discovery.py (+1/-1 lines)
  • validators.py Updated validators.py (+4/-2 lines)
  • service.py Updated service.py (+5/-5 lines)
  • function_adapter.py Updated function_adapter.py (+1/-1 lines)
  • apply_resource_change.py Updated apply_resource_change.py (+2/-2 lines)
  • call_function.py Updated call_function.py (+11/-4 lines)
  • plan_resource_change.py Updated plan_resource_change.py (+3/-3 lines)
  • decorators.py Updated decorators.py (+1/-1 lines)
  • enums.py Updated enums.py (+3/-3 lines)
  • test_availability.py Updated test_availability.py (+2/-2 lines)
  • conftest.py Updated conftest.py (+6/-143 lines)
  • test_conversion_memory.py Updated test_conversion_memory.py (+9/-10 lines)
  • test_hub_memory.py Updated test_hub_memory.py (+9/-10 lines)
  • test_schema_memory.py Updated test_schema_memory.py (+9/-10 lines)
  • uv.lock Updated uv.lock (+1249/-1151 lines)
  • Added _proto_block_cache: dict[int, tuple[PvsObjectType, pb.Schema.Block]] = {} in src/pyvider/conversion/schema_adapter.py streamline internal
    1 file
    • schema_adapter.py
  • Added _proto_schema_cache: dict[int, tuple[PvsSchema, pb.Schema]] = {} in the same file streamline internal
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock
  • Cache stores (source_obj, proto_result) tuples keyed by id(source_obj) — the source reference in the tuple prevents CPython from reusing the id via garbage collection (prevents stale cache hits) streamline internal
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock
  • is guard on lookup: checks that the cached entry’s source object is the same object instance, not just the same id value, to handle any GC edge cases streamline internal
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock
  • Result: hub-level allocations drop from 72K → 10.6K per 5K schema conversions (85% reduction) deprecate internal
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock
  • Baselines in tests/memray/baselines.json updated: hub_total_allocations 66404 → 10589 qualify internal
    1 file
    • baselines.json

Guard Expensive Debug Call Arguments

14 files changed
  • .gitignore Changes to .gitignore
  • VERSION Changes to VERSION
  • pyproject.toml Changes to pyproject.toml
  • schema_adapter.py Changes to schema_adapter.py
  • service.py Changes to service.py
  • apply_resource_change.py Changes to apply_resource_change.py
  • plan_resource_change.py Changes to plan_resource_change.py
  • enums.py Changes to enums.py
  • baselines.json Changes to baselines.json
  • conftest.py Changes to conftest.py
  • test_conversion_memory.py Changes to test_conversion_memory.py
  • test_hub_memory.py Changes to test_hub_memory.py
  • test_schema_memory.py Changes to test_schema_memory.py
  • uv.lock Changes to uv.lock
  • Wrapped debug() calls that require constructing expensive arguments (beyond f-string formatting) with is_debug_enabled() guards decouple errata
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock
  • Prevents object allocation and method calls that occur even when debug logging is disabled decouple behavioral
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock

Migrate Memray Infra to Shared Module

1 file changed
  • wrknv.memray Updated wrknv.memray
  • Migrated memray profiling infrastructure to the shared wrknv.memray module streamline internal
    1 file
    • wrknv.memray
  • Centralizes profiling setup, baseline loading, and assertion helpers across the pyvider family streamline internal
    14 files
    • .gitignore
    • VERSION
    • pyproject.toml
    • schema_adapter.py
    • service.py
    • apply_resource_change.py
    • plan_resource_change.py
    • enums.py
    • baselines.json
    • conftest.py
    • test_conversion_memory.py
    • test_hub_memory.py
    • test_schema_memory.py
    • uv.lock