Repository navigation
perf(model): construct model instances without the DI resolve + reflective invoke - #3464
Merged
Merged
Conversation
…ctive invoke Two more #3213 hot-path cuts on top of the #3462 inheritance fast path: 1. $createObjectFromRoot's model-instance branch ($initModelObject) now does a direct CreateObject + structured $initModelObject call and runs onDIcomplete manually — skipping the DI container's resolveMapping / $resolveInitArguments auto-wiring and the reflective Invoke() on the hottest path in the framework. Models explicitly mapped in the container (map/to/toFactory/asSingleton/asRequestScoped) keep the legacy path via the new Injector.hasExplicitMapping(). 2. $initModelObject's cached-class read no longer takes a $simpleLock: application.wheels.models[name] is only written after the class is fully built (config() + column processing), so a present entry is always complete and concurrent first loads are handled by the slow path. Measured on the #3213 rig (Lucee 7, H2, warmed): 3,000 x model().new() went from ~745 ms (#3462) to ~508 ms; the full chain 4.0.3 -> now is ~1,290 ms -> ~508 ms. RocketUnit suite ~180 ms. InjectorInterface declares hasExplicitMapping(); InjectorSpec pins its contract (false for unmapped names, true after map/to/toFactory/ asSingleton/asRequestScoped). Verification: local Lucee full suite 5554 pass/0 fail; RustCFML at baseline; boxlang matrix PASS; adobe2023 matrix shows only the known pre-existing failures (bcrypt #3463 + package-hardener symlink flake). Signed-off-by: Peter Amiri <peter@alurium.com>
bpamiri
added a commit
that referenced
this pull request
Oct 1, 2026
…grades and install (#3932) * docs(guides): correct stale 4.1 statements on error email, reload, upgrades and install - production-config: errorEmailAddress defaults to "" since 4.1.2 (GHSA-8gcv-3v9h-7gj2); with no recipient no error email is sent and a one-time warning goes to wheels.log - environments-and-configuration: an empty reloadPassword fails closed since 4.0.4 (#3062); #3059 is fixed, not open - performance-notes: describe the released fixes (4.0.6 #3236, 4.1.0 #3461/#3462/#3464, 4.1.1 #3656) instead of pointing at bleeding-edge - manual-installation: use the 4.1.2 release asset names and tag - upgrade: document the 4.1.0 app template drift advisory (#3379) - 3x-to-4x: the wheels.Testbox upgrade-check rule shipped in 4.0.4 - manual-upgrades: caution that the 4.1.1 .env boolean fix (#3641) must be applied by hand to the app-owned public/Application.cfc Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com> * docs(guides): give the full error-email sender fallback order errorEmailFromAddress, then errorEmailAddress, then the recipient (EventMethods.cfc). Review nit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com> --------- Signed-off-by: Peter Amiri <peter@alurium.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3213 — the third and final hot-path cut on model materialization.
What changed
$createObjectFromRootmodel fast path — the$initModelObjectbranch now does a directCreateObject+ structured call and runsonDIcompletemanually, skipping the DI container's resolve/auto-wire ($resolveInitArgumentsmetadata scan) and the reflectiveInvoke()on the framework's hottest path. Models explicitly mapped in the container keep the legacy path via the newInjector.hasExplicitMapping().$initModelObjectclass read without the lock —application.wheels.models[name]is only written after the class is fully built, so a present entry is always complete; the per-instance$simpleLockwas pure overhead (concurrent first loads still go through the locked slow path).Measured (#3213 rig, Lucee 7, H2, warmed)
model().new(): ~745 ms (perf(model): inherit the model mixin surface instead of copying it per instance #3462) → ~508 ms; the full chain from 4.0.3: ~1,290 ms → ~508 ms (~2.5×).Verification
hasExplicitMappingspecs included).