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

Faster locking through .NET 9's System.Threading.Lock #532

Merged
merged 13 commits into from
Aug 24, 2024

Conversation

MarkCiliaVincenti
Copy link
Contributor

No description provided.

@NyuwBot NyuwBot added the dependencies Pull requests that update a dependency file label Aug 12, 2024
@CLAassistant
Copy link

CLAassistant commented Aug 12, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

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

Many thanks. Will take a look when I'm back home.
Quick question, is that backwards compatible, since we target net7, net8 & net9 (actually I'm not sure if we even target net 7 anymore)?

@MarkCiliaVincenti
Copy link
Contributor Author

Many thanks. Will take a look when I'm back home. Quick question, is that backwards compatible, since we target net7, net8 & net9 (actually I'm not sure if we even target net 7 anymore)?

Yes it is. It's a backport of the new System.Threading.Lock. The performance pre net9 will be unaffected but the performance on net9+ will be improved.

@Lulalaby
Copy link
Member

Hey there!

I've given this PR many thoughts and came to the conclusion that it's personally a too big possible security risk to depend on such a small package.
Nothing personal, but I would prefer adapting the literally one-file "fix" into DisCatSharp.Common directly, instead of depending on the package.
No hard feelings please.

@MarkCiliaVincenti
Copy link
Contributor Author

You can. It has an MIT licence. But it goes without saying you won't get potential updates.

@Lulalaby
Copy link
Member

That's fine
I'll leave the PR open for a while tho to speak with the other maintainers again

@MarkCiliaVincenti
Copy link
Contributor Author

I'll amend the PR tomorrow.

@Lulalaby
Copy link
Member

Sounds good. We probably still take some time because both me and the other project lead are kinda mid burnout 😅

@MarkCiliaVincenti
Copy link
Contributor Author

OK done @Lulalaby

Lulalaby
Lulalaby previously approved these changes Aug 24, 2024
Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

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

Hey! I've reconsidered this pr and will go ahead with the dependency instead, makes it easier for us to automatically manage the updates + doesn't add a new license part.
Thank you!

@Lulalaby Lulalaby removed the request for review from JMLutra August 24, 2024 15:45
@Lulalaby Lulalaby requested a review from TheXorog August 24, 2024 15:45
@Lulalaby Lulalaby enabled auto-merge (squash) August 24, 2024 15:46
@MarkCiliaVincenti
Copy link
Contributor Author

Beautiful! But you should look at the original commit which conditionally doesn't add the dependency for net9

@Lulalaby Lulalaby disabled auto-merge August 24, 2024 15:48
@Lulalaby
Copy link
Member

"conditionally doesn't add the dependency for net9" A bit confused about that part, do you mean the change from me with the langversion through Package.targets?

TheXorog
TheXorog previously approved these changes Aug 24, 2024
Copy link
Member

@TheXorog TheXorog left a comment

Choose a reason for hiding this comment

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

@Lulalaby Please disable renovate's auto updates for the newly added package as a security measure.

Thanks for the PR!

@MarkCiliaVincenti
Copy link
Contributor Author

MarkCiliaVincenti commented Aug 24, 2024

"conditionally doesn't add the dependency for net9" A bit confused about that part, do you mean the change from me with the langversion through Package.targets?

Code like this so that if compiled for net9 or later won't add the unneeded dependency

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
  <PackageReference Include="Backport.System.Threading.Lock" Version="1.1.6" />  
</ItemGroup>

@Lulalaby
Copy link
Member

Oh I learned something new today! Haha thanks

@Lulalaby
Copy link
Member

@Lulalaby Please disable renovate's auto updates for the newly added package as a security measure.

Thanks for the PR!

7a6633a

Co-Authored-By: Mark Cilia Vincenti <[email protected]>
@Lulalaby Lulalaby dismissed stale reviews from TheXorog and themself via f3d76fe August 24, 2024 15:58
@Lulalaby Lulalaby merged commit 8941294 into Aiko-IT-Systems:main Aug 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Development

Successfully merging this pull request may close these issues.

5 participants