Conversation
Avoid rebuilding equivalent JSON schema rules and keep structural JSON subgrammars on the direct AST path.
Adapt rule caching to the direct GrammarBuilder implementation from the updated dependency branch.
This was referenced Jul 27, 2026
Ubospica
marked this pull request as ready for review
July 30, 2026 16:01
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.
依赖
本拉取请求基于 #726 的最新提交
823f682a。在 #726 合并前,本拉取请求包含其提交;缓存与结构化标签转换改动位于后续提交中。改动
性能
使用发布构建,先预热一次,再独立运行五次并取中位数。基线为 #726 的
be0afe61,缓存变更为9da247e6;最终提交71fd0b52将同一缓存逻辑适配到 #726 最新的直接GrammarBuilder实现。GrammarBuilder是代码内部的语法树构造器。JSONSchemaBench是包含约一万个真实 JSON Schema 的基准数据集;CloudFormation、Kubernetes和Service Schema是其中三个大型真实规格集合的名称。规则数指规范化后的语法规则数量。高重复人工规格的转换时间降低 74%–90%,规则数降低到原来的约 0.05%–2.25%。三个大型真实规格的提升为 1.05–1.16 倍,同时规则数降低 32%–39%。
验证