[DX] choose optimal job size to reach best speed

Aperta
#8,494 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
performance

Direzione di ricerca

Start by tracing where the default jobSize and timeoutSeconds values are defined and how worker chunks are scheduled. Reproduce the reported benchmarks for small and large file sets, including the timeout case with heavier rules. Done means choosing and documenting defaults that improve throughput without causing the reported child-process timeouts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

13 111 files

jobSize wall
16 218 s
150 86 s
300 75 s

279 files (a single module of the same project)

jobSize chunks workers wall
16 18 14 14.1 s
50 6 6 8.9 s
100 3 3 9.5 s
150 2 2 10.9 s
300 1 1 12.2 s

On 279 files even a single worker - jobSize: 300, no parallelism at all - beats the current default running on 14, because starting 14 processes costs more than the parallelism returns.

The optimum does move with corpus size (~50 for 279 files, 300+ for 13 111), but 100 is close to both, and anything in 100-200 beats 16 everywhere I measured.

So yes, increasing default job size to 100 might be a good idea, but:

jobSize and timeoutSeconds interact. A worker has to finish a whole chunk inside the per-job timeout, and 16 -> 150 multiplies the work per chunk by ~10. With a heavy rule set and a cold cache I hit exactly that - Child process timed out after 120 seconds, exit 1 - at jobSize: 150, where 16 completed. If the default goes up, the default timeout likely needs to go up with it, otherwise the failure mode moves from "slow" to "red build".

Originally posted by @webard in https://github.com/rectorphp/rector-src/issues/8489#issuecomment-5662569618

Lingua principale
PHP
Stelle
137
Fork
451
Merge medio
7h 11m
PR unite (30g)
129

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rectorphp/rector-src

Tutte le issue di rectorphp/rector-src

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.