Lower the cost of each launched wp process

Abierto
#385 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
php

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
42
Forks
29
Merge medio
21 h 6 min
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wp-cli/wp-cli-tests

Todos los issues de wp-cli/wp-cli-tests

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.