Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
LoopBack constructor-inspection performance reproduction Install dependencies: npm install Run the deterministic source-read reproduction: npm run reproduce Unmodified @loopback/context 9.0.0 prints: cold: cumulative source reads = 1 cached: cumulative source reads = 1 With the proposed Object.getPrototypeOf(target) !== Function.prototype guard before shouldSkipBaseConstructorInjection(target), it prints: cold: cumulative source reads = 0 cached: cumulative source reads = 0 Both variants verify that constructor injection metadata remains intact. Optional synthetic benchmark: npm run benchmark Run each variant in a fresh Node process. The first pass visits 4,000 fresh classes with distinct sources; the second exercises the existing metadata cache. Class generation and decorator setup are outside the timed region. Absolute timings depend on class size, runtime, garbage collection, and host load. This synthetic benchmark is separate from the application measurements reported in the issue and does not reproduce end-to-end startup.