Major Performance issue even with new caching?
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- openapi, php
- 领域
- api, performance
调研方向
从 github.com/lextira/openapi-parse-test 中的最小复现开始,并针对基于 v1.4 的 fork 和官方 v1.6 发布版运行 test.php。使用链接的 OpenAPI 规范作为工作负载,调查引用解析路径和缓存行为。完成的标准是,与 fork 相比,v1.6 路径不再显示已报告的解析回归问题。
由索引模型根据 Issue 内容生成。
描述
Hi @cebe
Almost 2 years ago we had a rather big issue with the performance for parsing an API-spec, where all components were store in another (the same) file. It took a couple of minutes to process. My collegue then proposed this PR #65
We ended up using this fork for the last two years now. This week I'm updating dependencies, and having seen that you merged #67 made me realize, that I can finally get rid of our fork.
However, running our test-suite after the update was rather painful: Instead of ~1s to parse our specification, like with our fork, it now took ~30s. I spent a couple of hours analyzing, but I couldn't find the issue. It looks like resolving references is painfully slow, it seems to take 100-300ms for each reference. Clearly, this was much faster in version 1.4, where our fork originates.
Therefore, I hope you can find a minute to look into it as well. I prepared a minimal test setup:
$ git clone https://github.com/lextira/openapi-parse-test
$ composer update
# now we have a composer install with our fork, see https://github.com/lextira/openapi-parse-test/blob/master/composer.json
$ php test.php
Start Reading...
Read took 1248 miliseconds!
Parsed file is 791837 characters long.
$ git checkout with-openapi-1.6
$ composer update
# new we are at the latest release of the official repository
$ php test.php
Start Reading...
Read took 37302 miliseconds!
Parsed File is 791837 characters long.
So with v1.6, reading the exact same file from the exact same URL takes almost 30 times longer than with v1.4 (and our custom cache implementation, which is very similar to your implemented cache now). For context, the specification used for the test is our official API documentation and can be found here: https://docs.lexgate.ch/api/
- 主要语言
- PHP
- 星标
- 500
- 派生
- 99
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cebe/php-openapi 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 48/100
cebe/php-openapi#250 ·
-
BC break in 1.8 未关闭
难度 5/5 一周以上 新手友好度 25/100
cebe/php-openapi#247 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 58/100
cebe/php-openapi#245 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 52/100
cebe/php-openapi#242 · 6 条评论 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 55/100
cebe/php-openapi#238 ·
相似的 Issue
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
UX
难度 2/5 1-3 小时 新手友好度 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
bug customer-reported
难度 2/5 1-3 小时 新手友好度 65/100
MagnaCapax/PMSS#949 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Automattic/static-site-importer#1829 ·