Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .NET 9 target, drop .NET 6 #828

Merged
merged 3 commits into from
Dec 17, 2024
Merged

Add .NET 9 target, drop .NET 6 #828

merged 3 commits into from
Dec 17, 2024

Conversation

MihaZupan
Copy link
Collaborator

Unlike in the past, there is now a reason to bump TFMs even when not explicitly using new APIs due to language changes that can target better overloads when recompiling (e.g. params span or OverloadResolutionPriority).
I don't know of any places where that would kick in for Markdig right now, but there are some neat new APIs in 9.0 that might be interesting to play with here.

I've also added back older TFMs to the test project so we're not completely without coverage (given we have a bit of conditionally-compiled code & polyfills). Skipped framework though cuz CI was being weird 🤷‍♂️

Some initial numbers without any Markdig changes on a large document (.NET 9 perf blog post ~570 KB):

Method Runtime Mean Error
Parse .NET 8.0 1,015.0 us 3.78 us
Parse .NET 9.0 926.8 us 3.58 us
ParseAdvanced .NET 8.0 2,892.6 us 17.57 us
ParseAdvanced .NET 9.0 2,803.9 us 4.20 us
Render .NET 8.0 459.2 us 5.76 us
Render .NET 9.0 425.7 us 5.38 us
RenderAdvanced .NET 8.0 585.2 us 10.13 us
RenderAdvanced .NET 9.0 489.8 us 5.35 us

@@ -13,6 +13,9 @@ jobs:
build:
uses: xoofx/.github/.github/workflows/dotnet.yml@main
with:
dotnet-version: '6.0 8.0'
Copy link
Collaborator Author

@MihaZupan MihaZupan Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing dotnet-version: '6.0 8.0 9.0' to the setup-dotnet action ends up building the latest LTS + the first item in the list.
With 6.0 8.0 that just happens to (currently) match the intended result.

@xoofx xoofx merged commit 57fad6f into xoofx:master Dec 17, 2024
1 check passed
@xoofx
Copy link
Owner

xoofx commented Dec 17, 2024

Thanks!

@snnz
Copy link
Contributor

snnz commented Dec 22, 2024

This is nice. But those whose projects are targeting .NET 6 will now receive a bonus with the updates, in a form of .NET Standard 2.1 DLL that misses some features of the .NET versions, like locals init switched off, and everything that depends on the "NET" condition.

@MihaZupan
Copy link
Collaborator Author

Such projects should likely focus on moving to a supported .NET runtime before updating their Markdig version then, especially if performance is a concern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants