python / python/cpython

Parallelize deepfreeze.py

Đang mở
#94,727 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

3.13 build type-feature
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
558

Mô tả

Feature or enhancement

I propose to parallelize deepfreezing to speed up compile time for core devs.

Pitch

deepfreezing / deepfreeze.py is a choke point for building CPython. Deepfreezing happens very late in the build process and takes considerable amount of time, especially for pydebug builds. Deepfreezing is a single process and does not benefit from multiple cores. Every build that touches a core file will result in re-freezing. On my system and with ccache populates, make spends between 60 to 75% time just in deepfreeze.py for debug builds. For regular builds it's about 25-30% of total build time.

$ ./configure -C --with-pydebug
$ make clean
$ time make

real    0m9,339s
user    0m13,630s
sys     0m2,657s
$ rm Python/deepfreeze/deepfreeze.c
$ time make Python/deepfreeze/deepfreeze.c

real    0m7,267s
user    0m7,033s
sys     0m0,204s

The process can be parallelized. One possible solution is to split the work. For each input module create a make rule that outputs an inc file, e.g. Python/deepfreeze/"importlib._bootstrap.inc. An another rules creates deepfreeze.c with #include "importlib._bootstrap.inc, ... This keeps all code in one object file.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với Python/deepfreeze/deepfreeze.py và các lệnh build được nêu trong issue, sau đó truy vết cách Python/deepfreeze/deepfreeze.c được tạo. Đánh giá các đầu ra .inc theo từng đầu vào được đề xuất và các quy tắc build. Hoàn thành khi deepfreezing có thể sử dụng nhiều core, đồng thời tạo ra đầu ra deepfreeze.c bắt buộc và giữ nguyên quy trình build hiện tại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.