Every new system compiles its variable files again, which sys.monitoring coverage retains
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with TaxBenefitSystem.add_variables_from_file and coverage/sysmon.py to trace how variable files are compiled and how SysMonitor.code_objects retains code objects. The issue proposes compiling each file once per process and executing it in each system's own module; check that modules, classes, functions, and globals remain separate. Done means repeated system creation no longer accumulates code objects under sys.monitoring; the issue links pull request #608, which is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
TaxBenefitSystem.add_variables_from_file compiles each variable file again for every new system (spec.loader.exec_module), so every system gets new code objects for the same source.
Coverage's sys.monitoring core keeps every code object it has seen alive until the process exits, so that it can key its records by id(code) (SysMonitor.code_objects in coverage/sysmon.py). It is coverage's default on Python 3.14, and opt-in on 3.12 and 3.13 with COVERAGE_CORE=sysmon. Under it, every system a process builds is retained as code objects, whatever happens to the system.
Measured on policyengine-uk (Python 3.13, coverage 7.16.2, core 3.33.2), one property-test file run serially: each Simulation left about 2,500 code objects and 3.6 MB of traced heap behind; with the C tracer or no coverage, memory stayed flat. On CI this grew four pytest-xdist workers to 15.3 of a runner's 15.6 GiB (PolicyEngine/policyengine-uk#2330).
A file's code object doesn't depend on the system that runs it. Compiling each file once per process and running that code object in each system's own module keeps every system's modules, classes, functions and globals separate, and removes the retention. It also saves the unmarshalling: building a UK system took 0.180 s of CPU instead of 0.289 s (median of 8, no coverage).
This is separate from #520 (the modules left in sys.modules), which this doesn't change.
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 30
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/policyengine-core
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
PolicyEngine/policyengine-core#605 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PolicyEngine/policyengine-core#549 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`restore_simulation` silently drops memberless group entitiesCó thể đã có người làm @Adelagric đã nhận 32 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PolicyEngine/policyengine-core#547 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
PolicyEngine/policyengine-core#614 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
A reform simulation's baseline reads the reform's default for people the situation gives no valueCó thể đã có người làm @MaxGhenis đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
PolicyEngine/policyengine-core#612 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của PolicyEngine/policyengine-core
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aws-samples/sample-per-model-bedrock#191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
PyTomography/PyTomography#331 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
effort: low prio: low ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
digitalfabrik/integreat-cms#4616 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
FuRongJun-1999/dsh-memory#226 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug difficulty:2 good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
MakazhanAlpamys/Soup#1865 ·
Maintainer thường phản hồi trong vòng 1 ngày