pyvider-cty
2026-03-21
Micro-optimizations in conversion and codec hot paths with memray infrastructure
32 files · 2,177+ · 899-
Allocation-reduction optimizations in hot paths
8 files changed
codec.py+32 -50 linesadapter.py+30 -7 linesraw_to_cty.py+104 -77 lineslist.py+11 -22 linesmap.py+12 -21 linesstring.py+22 -31 linesobject.py+34 -43 linesrecursion.py+64 -100 lines
- Replaced list.extend([a, b]) patterns with two list.append() calls in collection type modules to avoid temporary list allocation
streamline
internal
3 files
list.pymap.pyobject.py
- Replaced list(dict.values()) with direct reversed(dict.values()) to eliminate intermediate list allocation
streamline
internal
2 files
map.pyobject.py
- Cached structural key tuples for recurring primitive values to avoid repeated tuple construction in codec and type modules
streamline
internal
1 file
codec.py
- Replaced per-call lambda expressions with module-level function definitions in raw_to_cty.py and type modules
streamline
internal
1 file
raw_to_cty.py
- Replaced sorted(list(iterable)) with sorted(iterable) to remove redundant intermediate list
streamline
internal
1 file
raw_to_cty.py
- Removed error_boundary context manager wrapping from serialization and deserialization paths to reduce per-call overhead
streamline
internal
1 file
codec.py
Memray stress-testing infrastructure
9 files changed
memray_analysis.py+244 -0 linesmemray_codec_stress.py+126 -0 linesmemray_conversion_stress.py+133 -0 linesmemray_inference_stress.py+98 -0 linesmemray_unify_stress.py+97 -0 linesmemray_validation_stress.py+141 -0 linesrun_memray_stress.py+107 -0 linestest_validation_memory.py+17 -0 linestest_spec_compliance.pyModified
- Added seven memray stress scripts covering codec, conversion, inference, unify, validation, and aggregate analysis
qualify
internal
7 files
memray_analysis.pymemray_codec_stress.pymemray_conversion_stress.pymemray_inference_stress.pymemray_unify_stress.pymemray_validation_stress.pyrun_memray_stress.py
- Added memray validation memory test and excluded memray tests from default pytest run
qualify
internal
2 files
test_validation_memory.pytest_spec_compliance.py
Dependency pinning and build configuration
5 files changed
VERSION+1 -1 linespyproject.toml+10 -2 linesuv.lock+609 -550 lineswrknv.toml+4 -0 linesMakefile+42 -0 lines
- Pinned provide-foundation>=0.3.21,<0.4 in pyproject.toml and regenerated lock file
baseline
internal
2 files
pyproject.tomluv.lock
- Bumped version to 0.3.21 and added Makefile for build tasks
baseline
internal
2 files
VERSIONMakefile
- Updated wrknv.toml workspace configuration
baseline
internal
1 file
wrknv.toml
Type checking and formatting fixes
4 files changed
.actrc+12 -16 lines.gitignore+6 -0 linesHANDOFF.md+119 -0 linespyproject.tomlModified
- Suppressed msgpack import-untyped mypy error and added msgpack to mypy ignore list
remediate
internal
1 file
pyproject.toml
- Applied ruff 0.15.7 formatting across memray tests
baseline
internal
7 files
__init__.pyconftest.pytest_codec_memory.pytest_conversion_memory.pytest_inference_memory.pytest_unify_memory.pytest_validation_memory.py
- Updated .actrc configuration and added .provide/HANDOFF.md
baseline
internal
3 files
.actrc.gitignoreHANDOFF.md