Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Performance: five hot spots that cost 10-44% of a request, each fixable inside its function

オープン
#675 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@guidol-ive がすでに取り組んでいます。

2026年10月28日 から。

  • #676 @guidol-ive による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php, xml

調査の方向性

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 の本文から書いたものです。

説明

Impact: Medium Level: Easy Type: Bug Value: Visitors

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PlanBCode/hypha のほかの issue

PlanBCode/hypha の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。