Comments (6)
You're right. The cache is loaded using catalogManager.LoadAsync()
and then this CompositionConfiguration.Create()
API is called. I guess I need to re-work my caching mechanism to avoid this when loading from cache.
from vs-mef.
FindLoops
isn't called when loading a graph from the cache. It's only called from CompositionConfiguration.Create(catalog)
. So you might have cached the catalog, but you're creating the graph at runtime, and that's when loops must be detected.
If you actually cache the graph itself, it wouldn't execute this code.
Regarding the GC pressure, I see exactly one use of the Where
extension method. We might be able to replace this in order to avoid some allocations. But if you meant to be caching the graph and can fix that, the cost of creating the graph will entirely go away.
from vs-mef.
Use the CachedComposition
class here to cache the graph itself.
from vs-mef.
This will certainly improve startup performance in our app. Thanks for that link!
Still, I think you should get rid of those Where
and Select
calls. Together they account for 200 MB allocations in our huge app.
from vs-mef.
Together they account for 200 MB allocations in our huge app.
I doubt that. I think you're misattributing all the code that runs in the delegates to the use of Where
and Select
directly. If we removed use of those extension methods we'd still need to run the code in the delegates, so almost all those allocations would still occur.
from vs-mef.
Possibly. But a million enumerator allocations would certainly be of importance. We have an enormous amount of exports and imports.
from vs-mef.
Related Issues (20)
- Where are the release notes? HOT 1
- Can vs-mef export `IFoo<>`? HOT 1
- Consider adding AllowRejection to formalize rejection HOT 5
- Types containing naked type parameters as elements in a base class incorrectly fail discovery HOT 2
- Consider adding a test helper library
- Publish Updated NuGet Package HOT 1
- CompositionFailedException is not serializable
- LazyMetadataWrapper not super performant HOT 2
- Composition Analyzer package does not install when using packages.config HOT 2
- Install of latest alpha 16.9.6 fails for .NET-Framework 4.7.2 HOT 1
- Analyzers assembly needs to increment version in every NuGet package
- Lots of (most likely duplicate) assemblyname instances HOT 4
- Analyzer could detect duplicate imports HOT 2
- RuntimePartLifecycleTracker.CreateValue picks wrong ImportingConstructor with generic type argument in signature
- Add analyzer to detect when a class has more than one `ImportingConstructor` attribute HOT 1
- Analyzer to ensure correct C# nullable annotation when AllowDefault = true HOT 1
- Allow C# records to be used as metadata views HOT 1
- Equivalent SatisfyImportsOnce HOT 3
- Expose assembly name that provides exported part HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vs-mef.