Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature/net 6 support #62

Merged
merged 18 commits into from
Jan 11, 2022
Merged

Feature/net 6 support #62

merged 18 commits into from
Jan 11, 2022

Conversation

kenny-sellers
Copy link
Collaborator

@kenny-sellers kenny-sellers commented Jan 7, 2022

Fixes: #46

Description

Adding .NET 6 Support

Merge Checklist

  • Added unit or integration tests (if not explain)
  • Benchmarks are equivalent or faster

Copy link
Contributor

@SkyeHoefling SkyeHoefling left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, this looks good overall. I have a couple notes that I would like resolved.

In the meantime, I am going to see what I can do about the benchmarking to see if we can include it in this PR

framework: 'net6'
- os: windows-2019
architecture: 'x64'
framework: 'net6'
Copy link
Contributor

Choose a reason for hiding this comment

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

The winforms build is out of sync with what is happening in the PR build. Can you take a look and make sure the build_main.yml is correct. There should only be 1 build command like this:

- name: Build WinForms App
  run: dotnet build -c Release /p:Platform=${{ matrix.architecture }}
  working-directory: ./samples/WinformsApp/WinformsApp.${{ matrix.framework }}

# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
Copy link
Contributor

Choose a reason for hiding this comment

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

This project doesn't official support Visual Studio 2022, this statement should not be updated. The C++ code fails when using the compilers in Visual Studio 2022 and we only support 2019.

@SkyeHoefling
Copy link
Contributor

/benchmark

@SkyeHoefling
Copy link
Contributor

I updated the benchmark project to support running under net48, net5, and net6. After a successful run we will need to update the saved results as the table will be slightly different from what is stored in the repository. The benefit here is we will be able to look at differences between all our supported platforms.

Let's wait and see with the CI says, I noticed locally there is a very small memory leak in net6 and net48 - under 200 bytes

@SkyeHoefling
Copy link
Contributor

benchmarks failed because .NET 6 wasn't installed on job benchmark-run. I fixed this in main, let's try running them again.

@SkyeHoefling
Copy link
Contributor

/benchmark

@SkyeHoefling
Copy link
Contributor

I just peaked at the result of the benchmark build for Thumbnails and it includes net48 and net6 but not net 6. We need to add another ensure .NET SDK command to ensure .NET 5 is installed. See output https://github.com/FileOnQ/Imaging.Heif/actions/runs/1678150679

Method Job Runtime Mean Error StdDev Median Gen 0 Gen 1 Gen 2 Allocated Allocated native memory Native memory leak
Thumbnail_Write Job-RFREVW .NET 5.0 NA NA NA NA - - - - - -
Thumbnail_ToArray Job-RFREVW .NET 5.0 NA NA NA NA - - - - - -
Thumbnail_ToSpan Job-RFREVW .NET 5.0 NA NA NA NA - - - - - -
Thumbnail_ToStream Job-RFREVW .NET 5.0 NA NA NA NA - - - - - -
Thumbnail_Write Job-LTLQYG .NET 6.0 55.58 ms 1.052 ms 1.475 ms 55.03 ms - - - 832 B 5,125,137 B -
Thumbnail_ToArray Job-LTLQYG .NET 6.0 55.67 ms 1.075 ms 1.103 ms 55.67 ms - - - 66,888 B 5,124,325 B -
Thumbnail_ToSpan Job-LTLQYG .NET 6.0 53.05 ms 1.054 ms 1.732 ms 52.23 ms - - - 600 B 5,124,581 B -
Thumbnail_ToStream Job-LTLQYG .NET 6.0 52.51 ms 0.986 ms 0.922 ms 52.56 ms - - - 66,952 B 5,124,581 B -
Thumbnail_Write Job-UALGFG .NET Framework 4.8 53.53 ms 1.062 ms 2.376 ms 52.91 ms - - - 74,504 B 5,125,459 B 292 B
Thumbnail_ToArray Job-UALGFG .NET Framework 4.8 54.69 ms 1.079 ms 2.627 ms 53.92 ms - - - 74,504 B 5,125,163 B 292 B
Thumbnail_ToSpan Job-UALGFG .NET Framework 4.8 53.01 ms 1.035 ms 1.382 ms 52.94 ms - - - 8,192 B 5,125,163 B 292 B
Thumbnail_ToStream Job-UALGFG .NET Framework 4.8 55.46 ms 1.107 ms 2.133 ms 55.69 ms - - - 140,816 B 5,125,163 B 292 B

@SkyeHoefling
Copy link
Contributor

/benchmark

@SkyeHoefling
Copy link
Contributor

@kenny-sellers can you take a look at the memory leak noted for .NET 4.8

@kenny-sellers
Copy link
Collaborator Author

@ahoefling Just for documentation purposes. We are also seeing a memory leak with Primary images. That one is 234B.

@SkyeHoefling
Copy link
Contributor

Thanks for confirming the issue. I don't think we should have the memory leak or benchmarking hold up this PR. @kenny-sellers can you create a new issue to track the memory leak and include the .NET Framework benchmarks to document the problem.

I will make another pass at the code here and see what we need to do to close this out

Copy link
Contributor

@SkyeHoefling SkyeHoefling left a comment

Choose a reason for hiding this comment

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

@kenny-sellers I noted all the benchmark changes that need to be reverted, can you make the changes and update the PR

@@ -3,7 +3,7 @@ name: Benchmark
on:
pull_request_target:
branches: [ main ]
types: [ opened ]
types: [ opened, synchronize ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove testing action trigger

Suggested change
types: [ opened, synchronize ]
types: [ opened ]

@@ -73,7 +73,7 @@ jobs:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.302
dotnet-version: 6.0.101
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark build changes, this will be captured in another work item

Suggested change
dotnet-version: 6.0.101
dotnet-version: 5.0.302

Comment on lines 117 to 118
architecture: 'AnyCPU'
platform: 'net5'
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark build changes, this will be captured in another work item

Suggested change
architecture: 'AnyCPU'
platform: 'net5'

@@ -135,7 +137,7 @@ jobs:
working-directory: ./benchmarks/tools

- name: Benchmark
run: dotnet run -c Release -b ${{ matrix.benchmark }}
run: dotnet run -c Release -f net6.0 -b ${{ matrix.benchmark }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark build changes, this will be captured in another work item

Suggested change
run: dotnet run -c Release -f net6.0 -b ${{ matrix.benchmark }}
run: dotnet run -c Release -b ${{ matrix.benchmark }}

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="15.0">

<Target Name="ClearPackageCache" BeforeTargets="Build" Condition="'$(CI)' == 'false'">
<Target Name="ClearPackageCache" BeforeTargets="DispatchToInnerBuilds" Condition="'$(CI)' == 'false'">
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark changes

Suggested change
<Target Name="ClearPackageCache" BeforeTargets="DispatchToInnerBuilds" Condition="'$(CI)' == 'false'">
<Target Name="ClearPackageCache" BeforeTargets="Build" Condition="'$(CI)' == 'false'">

@@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net48;net5.0;net6.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark changes

Suggested change
<TargetFrameworks>net48;net5.0;net6.0</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>

@@ -7,7 +7,9 @@

namespace FileOnQ.Imaging.Heif.Benchmarks
{
[SimpleJob(RuntimeMoniker.Net48, launchCount: 1, invocationCount: 1)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark changes

Suggested change
[SimpleJob(RuntimeMoniker.Net48, launchCount: 1, invocationCount: 1)]

[SimpleJob(RuntimeMoniker.Net50, launchCount: 1, invocationCount: 1)]
[SimpleJob(RuntimeMoniker.Net60, launchCount: 1, invocationCount: 1)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark changes

Suggested change
[SimpleJob(RuntimeMoniker.Net60, launchCount: 1, invocationCount: 1)]

@@ -7,7 +7,9 @@

namespace FileOnQ.Imaging.Heif.Benchmarks
{
[SimpleJob(RuntimeMoniker.Net48, launchCount: 1, invocationCount: 1)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark changes

Suggested change
[SimpleJob(RuntimeMoniker.Net48, launchCount: 1, invocationCount: 1)]

[SimpleJob(RuntimeMoniker.Net50, launchCount: 1, invocationCount: 1)]
[SimpleJob(RuntimeMoniker.Net60, launchCount: 1, invocationCount: 1)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert benchmark changes

Suggested change
[SimpleJob(RuntimeMoniker.Net60, launchCount: 1, invocationCount: 1)]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ahoefling I pushed the reverts!

@SkyeHoefling SkyeHoefling mentioned this pull request Jan 11, 2022
@SkyeHoefling
Copy link
Contributor

/benchmark

@SkyeHoefling
Copy link
Contributor

As long as the builds and benchmarks succeed, we can merge this PR

@SkyeHoefling
Copy link
Contributor

Benchmark is failing, because we need the script updated in main. We will clean this up in #66. If the current build passes we will merge this PR

@SkyeHoefling SkyeHoefling merged commit 61e0e6d into main Jan 11, 2022
@SkyeHoefling SkyeHoefling deleted the feature/net-6-support branch January 11, 2022 16:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add .NET 6 Support
2 participants