SD-31 · DEPENDENCY INJECTION FRAMEWORK · INTERACTIVEBreak it.
Break it.
Then fix it.
One process, 16 cores, 3,000 bindings, and every web request resolves its own object graph. Turn up the requests, watch what the container costs, and add the parts a real DI framework needs. Every switch is a decision you would defend in an interview.
CHALLENGEServe 30K requests/s in one process with p99 under 10 ms, no errors, a validated graph and startup under 2 s.
StatusSTRAINEDAt 10K requests per second
Request p997 msTarget under 10 ms
Errors0%Nothing dropped
Startup4 sTarget under 2 s
Container CPU40%200 µs of each 500 µs request
Web requestsLIVE
10K req/s · 200 objects eachtraffic source
Resolver · 16 coresOK
Compiled plans, 1 µs/object2.0M objects/s · 40% of CPU
Binding registryUNCHECKED
Not checked until used3,000 bindings, frozen
StartupSLOW START
Scan 3,000 classes4 s per process start
Global container lockOK
40 µs held per request400 ms held per second
Request scopesOK
Closed and disposed in reverse10K opened/s
Connection poolOK
200 connections, held 2 ms20 / 200 in use
Graph errors will show up in production. A missing binding or a singleton holding a request-scoped object is found only by the first request that hits it. Walk the whole graph at build and report every error with its path.
15 → 1 µsPer object builtA cached plan replaces reflection with a direct constructor call.
25K/sOne global lock's ceiling40 µs a request under one lock, whatever the core count.
200 → 2 msConnection heldClosing the request scope returns it at once instead of at garbage collection.
0.3 sStartup with codegenDown from 5.5 s, and graph errors fail the compile.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.