phmonte / Buildalyzer

A utility to perform design-time builds of .NET projects without having to think too hard about it.
MIT License
589 stars 92 forks source link

feat: adding cache to dotnet --info content #263

Closed phmonte closed 2 months ago

phmonte commented 2 months ago

Feature:

Cache dotnet --info result per project

Description

In some scenarios, executing dotnet --info may take longer than desired, especially when executed within containers with few resources.

This pr adds a cache where the key is the full path of the project.

phmonte commented 2 months ago

@Corniel do you have any other considerations?

Corniel commented 2 months ago

After further inspection, I wondered: why caching the lines? If the lines don't change, the Info does not change either. As the DotNetInfo is immutable, I would argue that the result of the parsing should be cached, not the input.

phmonte commented 2 months ago

@Corniel thanks, it would really make sense to cache the output, I'll make the change.