Skip to content

InterMix 10: split dev and compiled production DI runtimes - #129

Merged
abmmhasan merged 261 commits into
mainfrom
perf/di-hot-path
Aug 29, 2026
Merged

InterMix 10: split dev and compiled production DI runtimes#129
abmmhasan merged 261 commits into
mainfrom
perf/di-hot-path

Conversation

@abmmhasan

@abmmhasan abmmhasan commented Aug 29, 2026

Copy link
Copy Markdown
Member

InterMix 10 performance architecture and implementation branch.

Primary goal: maximize sustained successful request throughput while preserving DI functionality, following PHPForge engineering principles.

Architecture direction:

  • explicit development path: optimized dynamic/reflection runtime; no compiler required
  • explicit production path: finalized/compiled generated PHP runtime
  • same observable DI semantics across development/production boundaries
  • immutable build-time definition graph and compiler planning
  • direct compiled dependency edges rather than recursive public string-based get() calls
  • specialized singleton/transient/scoped paths and scope seeds
  • targeted runtime islands only for genuinely runtime-dependent behavior
  • compiled tags and lifecycle/scope-leave specialization
  • production deoptimization with singleton/scoped identity transfer
  • deployment-time artifact validation and prevalidated loading
  • zero Repository/Reflection/resolver machinery in fully static generated artifacts
  • CacheLayer remains optional
  • Closure serialization remains explicit and is never implicit in normal DI resolution

Architecture draft: docs/intermix-10-performance-architecture.md

Authoritative final completion checklist: docs/intermix-10-final-checklist.md

InterMix standalone status: COMPLETE.

  • all 33 InterMix architecture checklist items resolved
  • PHP 8.4/8.5 stable + lowest QA matrices green
  • PHPStan/Psalm green on PHP 8.4 and 8.5
  • clean production install green
  • native PHPForge benchmark jobs green on PHP 8.4 and 8.5
  • no project-level ic:* command override
  • no temporary diagnostic workflow
  • final parity/error-surface and fully-static-artifact tests included

Representative final benchmark snapshot:

  • PHP 8.4: native transient 0.203 µs; generated static transient 0.367 µs; dynamic transient 20.031 µs; static warm singleton 0.117 µs
  • PHP 8.5: native transient 0.194 µs; generated static transient 0.356 µs; dynamic transient 20.112 µs; static warm singleton 0.118 µs

The immutable ID→slot candidate was benchmarked but not adopted: its nominal gain was not stable enough across the non-stable CI runners to justify additional production representation complexity. The benchmark remains as evidence.

Comment thread src/DI/Container.php Fixed
Comment thread src/DI/Managers/InvocationManager.php Fixed
Comment thread src/DI/Resolver/ClassResolver.php Fixed
Comment thread src/DI/Resolver/ClassResolver.php Fixed
Comment thread src/DI/Resolver/DefinitionResolver.php Fixed
Comment thread src/DI/Resolver/ParameterResolver.php Fixed
Comment thread src/DI/Resolver/ParameterResolver.php Fixed
@abmmhasan abmmhasan changed the title Perf: compress DI request hot path InterMix 10: split dev and compiled production DI runtimes Aug 29, 2026
Comment thread src/DI/Build/StaticPropertyPlanner.php Fixed
Comment thread src/DI/Build/StaticPropertyPlanner.php Fixed
Comment thread src/DI/Build/StaticRuntimePlanner.php Fixed
Comment thread src/DI/Build/StaticRuntimePlanner.php Fixed
Comment thread src/DI/Build/StaticRuntimeGenerator.php Fixed
@abmmhasan
abmmhasan marked this pull request as ready for review August 29, 2026 17:16
@abmmhasan
abmmhasan merged commit 8c7e202 into main Aug 29, 2026
13 checks passed
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