Performance: five hot spots that cost 10-44% of a request, each fixable inside its function
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- php, xml
- 領域
- backend, performance
調査の方向性
Start with the five named functions in language.php, base.php, database.php, and tagindex.php, then inspect the existing tests. The issue reports repeated work in each function and requires preserving every result; run the existing tests to check that behavior. Pull request #676 is already open against this issue.
索引モデルが issue の本文から書いたものです。
説明
Part of #411. I measured with Xdebug's profiler on a fictional site of the size of a real one: 1,300 pages, 300 published articles with tags, 60 users, a hypha.xml of 188 KB. The cache was warm and OPcache on. Each of these costs can be removed inside the function itself, without a change of structure:
| Where | What it does per request | Share of the time |
|---|---|---|
Language::getIsoList() (language.php) |
reads and decodes system/languages/languages.json on every call. dewikify_link() and wikify_link() call it for every link, so the page index called it 1,206 times |
44% of index/nl |
hypha_getUsedContentLanguages() (base.php) |
one XPath query per page to collect the languages, run on every page | 22% of nl/Start |
hypha_getPage() (base.php) |
walks every page and every language in PHP to find one page | 20% of an article |
HyphaDomAccessors::findXPath() (database.php) |
creates a new DOMXPath for every query (1,363 times on nl/Start) |
11% of nl/Start and 9% of an article for the constructor alone |
tagindexpage::sortPages() (tagindex.php) |
computes the sort date inside the usort comparison, so 972 times for 86 articles (a TODO in the code says so) |
5–9% of a tag page |
Throughput with the two Apache workers of the container, measured with hey -c 4:
| Page | req/s |
|---|---|
nl/Start |
164 |
index/nl |
24 |
tag/nl/Wonen |
66 |
| an article | 146 |
The fixes should keep every result the same, so the existing tests are the check.
- 主要言語
- JavaScript
- スター
- 5
- フォーク
- 9
- 平均マージ
- 19時間 10分
- マージ済み PR(30日)
- 12
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PlanBCode/hypha のほかの issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Type: Bug Value: Coders
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
PlanBCode/hypha#586 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
PlanBCode/hypha の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
solana-foundation/solana-web3.js#4015 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
gramps-project/gramps-web#1604 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue hacktoberfest help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
BinaryBaconLabs/todo-app#18 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
sutantyo/flight-watch#32 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信