Repository navigation
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
任务背景与目标
针对任务 [6028],通过细分互斥子阶段性能度量与多项精准优化,显著降低段落排版
br->typeset耗时与总体渐进排版开销。关键改动
lolly::system::timer中增加微秒级时间戳累计机制,消除子毫秒频繁调用的截断舍入误差;在tm_debug.hpp中引入bench_flush接口。typesetter.cpp、bridge.cpp、lazy_paragraph.cpp中精准切分 7 个互斥子阶段:br/bridge、br/concat、br/line_breaks、br/line_print、br/make_unit、br/line_end、br/merge,并在切片末尾冲刷输出,未覆盖残差 other 严格控制在 20% 以内(实测 16.6%)。edit_env_rep中缓存has_text_bg_color与text_bg_color,消除构建每个文本盒时对TEXT_BG_COLOR的哈希查找、tree转换与字符串比对。lazy_paragraph中每段重复创建的 4 个标点哈希集合静态化;line_print中单次获取叶子字符串,并对统一汉字直接跳过标点集合查询;cjk_auto_spacing与adjust_consecutive_puncts按需延迟计算邻居索引,纯中文字符行直接跳过中西文间距调整。atom_best采用array<lb_info_rep>紧凑值数组替代带指针包装的lb_info,消除数百万次小对象堆分配。br->typeset耗时中位数稳定在 19~20 ms,P95 <= 29 ms,完美匹配 60 FPS 交互友好区间。验收测试
tests/mogan/python/6028.py全部通过:vol05.stem:切片总数 1041,P50=20.0 ms,P95=29.0 ms,未覆盖残差 16.6%,总页数 17,213(>= 17,000),完整耗时 45.8s(<= 80s);xiyouji.stem:P50=29.0 ms,未覆盖残差 4.6%,总页数 517(>= 400),完整耗时 8.46s(<= 15s)。