ClassPublisher fold proof re-parses every selector per fold group (dominates compose; deadline failures after all pages compile)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- php
- Lĩnh vực
- performance
Hướng nghiên cứu
Start in ClassPublisher::publish(), then trace folds(), foldPreservesCascade(), and selector parsing through cascadeSelectors() and CssSelectorMatcher::parse(). Compare the published output and profiling results against the captured 5-page and 50-page plans; done means the output stays byte-identical while repeated selector parsing is reduced. The issue reports that 52 relevant unit test files pass, but names no specific test command.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
ClassPublisher::publish() dominates compose time on real imports. It is the main reason production imports finish compiling every page and then run past the 3,600 s capture deadline with no further progress (capture_deadline_exceeded). That was 64 failures last week, most with pages_built == pages_to_build.
Local profile of a 50-page Shopify import (SSI 1.39.38, compose split with extra StepTimer marks):
| compose step | time |
|---|---|
ClassPublisher::publish |
277 s of 384 s total compose |
| everything else | 107 s |
Cause
folds() calls foldPreservesCascade($sheets, $map) once per candidate fold group. Each call:
- re-splits every stylesheet (
cssPieces+CssValueSplitter::splitTopLevel); - runs
renamedPrelude()on every selector; and - parses every selector twice with
CssSelectorMatcher::parse()(before and after). This includes selectors that name none of the folded classes, whose text and weight cannot change.
Measured on the pre-publish plans, which have 39k–43k selectors: 2–40 fold groups mean up to about 3.4M selector parses. Some of those are long :where()/:is() lists, where parseCompound/matchingClose dominate.
Fix (prototyped, output byte-identical)
- Read the selectors once per publish (
cascadeSelectors()): each selector's text and the class tokens it names. - In
foldPreservesCascade(), skip selectors whose classes don't intersect the map. Only rename and re-weigh the ones that do. - Weigh specificity lazily, memoized per selector. The full weight list is only needed when a fold changes specificity, which is the existing conservative pairwise proof and stays unchanged.
Offline ClassPublisher::publish() on the two captured pre-publish plans, current trunk versus the patch:
| plan | trunk | patch | output |
|---|---|---|---|
| 5-page site | 75 s | 4.2 s | sha256(serialize($published)) identical |
| 50-page site | 67 s | 19 s | identical |
All 52 tests/unit files touching ClassPublisher, class namespaces or folds pass.
- Ngôn ngữ chính
- PHP
- Star
- 31
- Fork
- 7
- Merge trung bình
- 7 giờ 50 phút
- Pull request đã merge (30 ngày)
- 822
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 Automattic/blocks-engine
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Automattic/blocks-engine#7679 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/blocks-engine#4943 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/blocks-engine#4942 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Automattic/blocks-engine#4921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Automattic/blocks-engine#775 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Automattic/blocks-engine
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Automattic/static-site-importer#3462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpĐang mởenhancement feature: settings good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nextcloud/integration_openai#480 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
a11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
omeka/plugin-Contribution#84 ·