perf: reduce Flash PDF preparation across all demo samples (round 7) - #14
Merged
Merged
Conversation
myhloli
marked this pull request as ready for review
September 26, 2026 15:25
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flash PDF 在标题判定、源字符几何、共享行内证据和表格候选中重复准备数值与文本。此变更保留原业务判断及全部候选,复用当前阶段的只读准备并增加私有 Rust 批量计算。第七轮在第六轮冻结源码
843b599及匹配协议 7 二进制上继续优化。demo|all语料默认 all,递归发现全部 demo;冻结路径、SHA256、页数、区域输入、源码、扩展和依赖,不刷新金标。source_rows_plain合并源框选择、裁剪及旋转;普通只读字体按身份强引用复用,最多 4096 项,风险筛查/正式修复及各行分别准备。最终性能源码
aa0241827a0412da1709eb92a4cb5780ac19aa32。本机 Apple M4/16 GB,四组独立进程、一次预热、五次正式测量、交替顺序,RSS 单独采样;profiler、测试及构建不与最终计时并行。仅具体文档/指标越过 5% 时反序复测。公开解析尚差 0.374940s/2.29 个百分点。剩余热点为 PDFium 对象裁剪/矩阵/RGBA、源框 Python 记录准备、行构建、上下标打包及字体枚举。未降低输出等价或退化门槛。
密集样本 49.- 不计入 demo 目标:公开解析 1.896257 → 1.913316s(裁决变化 +0.90%),共享文本 0.604086 → 0.606766s(+0.44%)。
第六轮历史验收(151d39b → 843b599)为公开解析降低 8.29%(15% 目标未达到),共享文本降低 30.66%(25% 目标达到)。两轮分别同期复测,不把不同时期的秒数相加或相乘为累计收益。
验证:
aa02418的 CI 39 作业与 Native wheels 7 作业全部成功,覆盖 Python 3.10–3.14 与既有平台矩阵。Intel macOS 3.14 应用依赖限制继续单列,3.14 ABI 独立检查,完整 smoke 使用 3.13。首次候选 8546348 的测量因共享入口持续退化被拒绝,原值保留在 pre-fix-public/pre-fix-shared。混合字符分组与空页开销修复后,最终完整对比在同一版本重跑;较慢的 Python 单遍映射和会丢邻行证据的样式跳过尝试均撤销。
阶段提交 P0 1fb7305、P1 53df6cc、P2 fdd78f3、P3 23af3c8/8546348/aa02418。逐样本结果见 第七轮记录;独立本机原始证据为 output/pdf/rust-round7-20260926/REPORT.md、HOTSPOTS.md、stage-calls.json、performance-gates.json 与全部测量/视觉输出,不覆盖前轮产物。
性能源码 SHA256
dc8d902972b309e11881778598fd12edfb5f312cef38e9c7580432eea3e23f80,扩展799152ec326e20412a433ea41322e922701236c85ed907d59850a095c7ccc1ac;后续文档提交不改变生产源码或性能二进制,测量提交字段保持原样。共享分支上的既有 Office 图片预算提交 f12dd78 不属于本轮 PDF 优化,a124f29 仅修复其 Ruff 格式且 AST 相等。本 PR 保持 draft,未合并、未发布。