BitFaster.Caching icon indicating copy to clipboard operation
BitFaster.Caching copied to clipboard

Speed optimization for .NET 9.0+ through System.Threading.Lock

Open MarkCiliaVincenti opened this issue 8 months ago • 4 comments

MarkCiliaVincenti avatar Jun 28 '25 14:06 MarkCiliaVincenti

I have added a net9 build target with automated tests - you can merge master into your changes to get this.

Because System.Threading.Lock is only available on net9, you will need to make this change only for the net9 target using preprocessor directives, you can see a similar example for the lock statement in ConcurrentLfu here https://github.com/bitfaster/BitFaster.Caching/pull/697.

bitfaster avatar Jul 03 '25 07:07 bitfaster

Merged. The preprocessor directives are not needed because this is using a source-generated polyfill.

MarkCiliaVincenti avatar Jul 03 '25 08:07 MarkCiliaVincenti

Coverage Status

coverage: 99.062%. first build when pulling ee89e002413d331a0f5652d594b84d748bcfe56d on MarkCiliaVincenti:SystemThreadingLock into 422ab25e421121ab37372df4ecabed41293134a4 on bitfaster:main.

coveralls avatar Jul 03 '25 09:07 coveralls

@bitfaster ?

MarkCiliaVincenti avatar Dec 04 '25 14:12 MarkCiliaVincenti