dotnet / dotnet/maui

[xamlc] ~20% of time spent in `XmlTypeExtensions.GetTypeReference()`

Open
#11,533 0 comments 4 reactions 1 assignee Claimed by @jonathanpeppers View on GitHub
area-xaml perf/general proposal/open
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

While running `dotnet trace` on `dotnet build`, I noticed:

![image](https://user-images.githubusercontent.com/840039/203155248-b66c24a1-ec91-42e0-9385-b03f9b1320c0.png)

([See docs on how to do this](https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/tracing.md#how-to-dotnet-trace-our-build))

Is it possible to cache some of the calls here? There is some `string.Split()` that could also be improved, but that is probably a smaller thing to improve.

Most of the actual work is Mono.Cecil reading/doing things:

![image](https://user-images.githubusercontent.com/840039/203155942-18f74d6f-2d0a-410d-ae6f-60cff53e28c6.png)

### Public API Changes

n/a

### Intended Use-Case

Any time saved in XamlC is time saved in all incremental builds on all platforms.

### Logs

[mauibuild.zip](https://github.com/dotnet/maui/files/10060443/mauibuild.zip)

Looks at Thread 10 (18516) in the `.speedscope`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.