CPU Spike at startup
When calling for the first time OrderBy, it seems like it iterates on all types of all loaded assemblies. That does not scale and consumes 20% of the CPU for ~1 minute during the startup of my application.
Additionally, it seems like there is no synchronization around this operation so all threads are racing.
Is there an opportunity to lazily load the type metadata individually?
@verdie-g @StefH We are also experiencing unreasonably large CPU spikes on initialization. Is there any reason why all assemblies in the AppDomain are scanned by default? It seems weird to have such a broad type scanning strategy when actually most types cannot even be used without being white-listed explicitly.
To work around this, we are currently overriding GetCustomTypes directly to restrict loading to only types that we explicitly indicate, but would be nice to have a simpler way to do this, perhaps with a flag in the constructor, or the possibility of overriding GetAssemblies e.g. by passing a custom IAssemblyHelper.
Passing IAssemblyHelper is maybe an option.
For you case, you can also just implement your own IDynamicLinqCustomTypeProvider