Lower the cost of each launched wp process

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

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php

調査の方向性

Consult #384 for baseline CI timings and #257 for Xdebug conditions. Find where the framework spawns wp processes (likely PHP test harness) and add logic to disable Xdebug unless coverage/debug is set, plus an opcode cache for WP-CLI and package code while excluding per-scenario WordPress copies. Done means a draft PR shows reduced CI run times recorded against the baseline.

索引モデルが issue の本文から書いたものです。

説明

scope:testing

Almost all of the suite's run time is spent in the wp processes the scenarios launch; the Behat process itself accounts for about 3% of a run. Each wp call costs about 0.3 seconds, and the bundled commands make around 9,300 of them per suite run, plus the ones the framework makes itself.

Two things make each process more expensive than it needs to be:

  1. Xdebug. When Xdebug is loaded locally, every child process pays for it. Turning it off for the launched processes took a local cache-command run from 126 to 98 seconds. It should stay off unless coverage is collected or step debugging is requested (see #257).
  2. No opcode cache. Every process compiles WP-CLI and the package code from scratch, although that code does not change during a run. Caching only that code took a typical call from about 300 to 200 ms locally. The per-scenario WordPress copies must stay uncached: they are rewritten during scenarios, and a stale compiled file would change what a test exercises.

Measuring: take the baseline from #384, then open a draft PR, run the same CI jobs against it and record both results here before we decide.

主要言語
PHP
スター
42
フォーク
29
平均マージ
21時間 6分
マージ済み PR(30日)
24

環境構築

はじめの一歩

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

wp-cli/wp-cli-tests のほかの issue

wp-cli/wp-cli-tests の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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