Skip to content

perf(database): index migrations by name#2155

Merged
xHeaven merged 1 commit into
tempestphp:3.xfrom
xHeaven:perf/migration-lookup
Jun 5, 2026
Merged

perf(database): index migrations by name#2155
xHeaven merged 1 commit into
tempestphp:3.xfrom
xHeaven:perf/migration-lookup

Conversation

@xHeaven
Copy link
Copy Markdown
Member

@xHeaven xHeaven commented Jun 5, 2026

rehashAll() and validate() were rebuilding the full migrations list for every migration row in the database. So with 500 migrations, it copied/scanned the 500-item list 500 times instead of building it once.

@xHeaven xHeaven requested review from brendt and innocenzi as code owners June 5, 2026 11:48
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Benchmark Results

Comparison of perf/migration-lookup against 3.x (e667dcc305364b47b2588c50eaaaaa29462ec896).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
ViewRenderBench(benchExpressions) - 24.532mb 0.00% 487.034μs -6.39% ±3.13% +89.69%
ViewRenderBench(benchControlFlow) - 44.442mb 0.00% 665.058μs -5.63% ±3.27% +31.17%

Generated by phpbench against commit 2c3b83e

@brendt
Copy link
Copy Markdown
Member

brendt commented Jun 5, 2026

Feel free to merge when CI is done :)

@xHeaven xHeaven merged commit c699ab8 into tempestphp:3.x Jun 5, 2026
76 checks passed
@xHeaven xHeaven deleted the perf/migration-lookup branch June 5, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants