Skip to content

Load module items once lazily in Launcher#1282

Merged
1nf0rmagician merged 1 commit into
devfrom
fix/launcher-loading
Jun 19, 2026
Merged

Load module items once lazily in Launcher#1282
1nf0rmagician merged 1 commit into
devfrom
fix/launcher-loading

Conversation

@1nf0rmagician

Copy link
Copy Markdown
Member

Increases the performance when switching between modules in the launcher by caching module items and regions in the IShellNavigator service. This also removes recurring error logs caused by repeated assembly scans.

Note: I feel bad making the launcher config static, but it provides a significant benefit in the static Lazy context. Also the service is usually registered as a singleton and the config is one retrieved once from the config manager. Still, I'm open for suggestions to improve

Increases the performance when switching between modules in the launcher by caching module items and regions in the `IShellNavigator` service. This also removes recurring error logs caused by repeated assembly scans.
@1nf0rmagician 1nf0rmagician added this to the Framework 10.x milestone Jun 16, 2026
@1nf0rmagician 1nf0rmagician requested a review from dbeuchler June 16, 2026 13:04
@1nf0rmagician 1nf0rmagician self-assigned this Jun 16, 2026
@1nf0rmagician 1nf0rmagician added the enhancement New feature or request label Jun 16, 2026
Comment thread src/Moryx.Launcher/ShellNavigator.cs
Comment thread src/Moryx.Launcher/ShellNavigator.cs
@andreniggemann

Copy link
Copy Markdown
Collaborator

Could the static stuff be put into a simple singleton service?
That way it would still be cached and we would get rid of the static stuff.

@dbeuchler

Copy link
Copy Markdown
Member

Could the static stuff be put into a simple singleton service? That way it would still be cached and we would get rid of the static stuff.

I think @1nf0rmagician dont want to refactor the whole ShellNavigator in this PR, but yes this sounds good in another PR

@seveneleven

Copy link
Copy Markdown
Contributor

Could the static stuff be put into a simple singleton service? That way it would still be cached and we would get rid of the static stuff.

+1

That was also my take on "I feel bad making the launcher config static, but it provides a significant benefit in the static Lazy context" which I missed to submit.

@1nf0rmagician

Copy link
Copy Markdown
Member Author

Could the static stuff be put into a simple singleton service?

Yes, just as you suggest @andreniggemann and yes to what @dbeuchler responded. Also, separating it into a cache service would make this an opt-in feature at best, as it would require modifying the application build section. This is however, is not what I want to got for, as I consider the error spaming in the log from the repeated reflection attempts very "sub-optimal" at best.

@1nf0rmagician 1nf0rmagician merged commit 8e6c7da into dev Jun 19, 2026
12 of 13 checks passed
@1nf0rmagician 1nf0rmagician deleted the fix/launcher-loading branch June 19, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants