Code Monkey home page Code Monkey logo

Comments (6)

znakeeye avatar znakeeye commented on June 9, 2024 1

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.

AArnott avatar AArnott commented on June 9, 2024

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.

AArnott avatar AArnott commented on June 9, 2024

Use the CachedComposition class here to cache the graph itself.

from vs-mef.

znakeeye avatar znakeeye commented on June 9, 2024

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.

AArnott avatar AArnott commented on June 9, 2024

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.

znakeeye avatar znakeeye commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.