You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prevent garbage collection when iterating empty Simple Injector collections #1020
In Simple Injector v5.5, iterating the collection loggers always causes a new enumerator to be created, thus causing garbage collection, even when the collection of loggers is empty.
Because the injected collection is (in most cases) a Simple Injector-defined type (i.e. the internal ContainerControlledCollection<T>), it allows returning a single default enumerator.
This optimization is especially useful in scenarios the majority of cases contains no elements to iterate. This becomes more obvious when the iterated element itself is generic, for instance:
Activity
PERF: Iterating empty collections no longer causes garbage collection. …
PERF: Iterating empty collections no longer causes garbage collection. …
PERF: Iterating empty collections no longer causes garbage collection. …