Major Performance issue even with new caching?
まだ誰も着手していません。
評価
- 難易度
- 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 仕様をワークロードとして使用し、参照解決の経路とキャッシュの動作を調査します。完了条件は、v1.6 の経路で、fork と比較して報告された parsing のリグレッションがもはや発生しないことです。
索引モデルが 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cebe/php-openapi のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
cebe/php-openapi#250 ·
-
BC break in 1.8 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
cebe/php-openapi#247 · コメント 1 件 · リアクション 1 件 ·
-
php 8.4 deprecations オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
cebe/php-openapi#245 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
cebe/php-openapi#242 · コメント 6 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
cebe/php-openapi#238 ·
cebe/php-openapi の issue をすべて見る
似ている 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 ·