When ScopeValidation is on for the dependency injection container, we walk to resolution graph and find places where service lifetimes are mismatched (like singleton -> scoped). This logic currently doesn't mark visited services which leads to re-calculating results repeatedly which ends up being O(N!).
Run this example with scope validation on:
https://github.com/sergey-kolodiy/AspNetCore.DI