-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: c# 12, .net 8, upgraded all dependencies
- Loading branch information
Showing
172 changed files
with
10,879 additions
and
12,325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=WpfVncClient_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=WpfVncClient_002EAnnotations/@EntryIndexedValue">True</s:Boolean> | ||
|
||
|
||
|
||
|
||
</wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Linq; | ||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace Benchmarks | ||
namespace Benchmarks; | ||
|
||
public class ImmutableDictionaryLookup | ||
{ | ||
public class ImmutableDictionaryLookup | ||
{ | ||
private const int Index = 500; | ||
private readonly IImmutableDictionary<int, object> _dictionary= Enumerable.Range(0, 1000).ToImmutableDictionary(i => i, i => new object()); | ||
private const int Index = 500; | ||
|
||
[Benchmark] | ||
public object Indexer() | ||
{ | ||
if (!_dictionary.ContainsKey(Index)) | ||
return null; | ||
return _dictionary[Index]; | ||
} | ||
private readonly IImmutableDictionary<int, object> _dictionary = | ||
Enumerable.Range(0, 1000).ToImmutableDictionary(i => i, _ => new object()); | ||
|
||
[Benchmark] | ||
public object TryGet() | ||
[Benchmark] | ||
public object? Indexer() => CollectionExtensions.GetValueOrDefault(_dictionary, Index); | ||
|
||
[Benchmark] | ||
public object? TryCatch() | ||
{ | ||
try | ||
{ | ||
if (!_dictionary.TryGetValue(Index, out object value)) | ||
return null; | ||
return value; | ||
return _dictionary[Index]; | ||
} | ||
|
||
[Benchmark] | ||
public object TryCatch() | ||
catch | ||
{ | ||
try | ||
{ | ||
return _dictionary[Index]; | ||
} | ||
catch | ||
{ | ||
return null; | ||
} | ||
return null; | ||
} | ||
} | ||
|
||
[Benchmark] | ||
public object? TryGet() => CollectionExtensions.GetValueOrDefault(_dictionary, Index); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace Benchmarks | ||
namespace Benchmarks; | ||
|
||
public class LockOverhead | ||
{ | ||
public class LockOverhead | ||
{ | ||
private int _value; | ||
private object _lock = new object(); | ||
private readonly object _lock = new(); | ||
private int _value; | ||
|
||
[Benchmark] | ||
public void IncreaseWithoutLock() | ||
{ | ||
[Benchmark] | ||
public void IncreaseWithLock() | ||
{ | ||
lock (_lock) | ||
_value++; | ||
} | ||
} | ||
|
||
[Benchmark] | ||
public void IncreaseWithLock() | ||
{ | ||
lock (_lock) | ||
_value++; | ||
} | ||
[Benchmark] | ||
public void IncreaseWithoutLock() | ||
{ | ||
_value++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
using System.Runtime.Intrinsics.X86; | ||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace Benchmarks | ||
namespace Benchmarks; | ||
|
||
public class MaxValueToDepth | ||
{ | ||
public class MaxValueToDepth | ||
{ | ||
private const int MaxValue = 255; | ||
private const int MaxValue = 255; | ||
|
||
[Benchmark] | ||
public uint WhileLoop() | ||
{ | ||
uint val = MaxValue; | ||
uint depth = 0; | ||
while (val != 0) | ||
{ | ||
depth++; | ||
val >>= 1; | ||
} | ||
[Benchmark] | ||
public uint PopCount() => Popcnt.PopCount(MaxValue); | ||
|
||
return depth; | ||
[Benchmark] | ||
public uint WhileLoop() | ||
{ | ||
uint val = MaxValue; | ||
uint depth = 0; | ||
while (val != 0) | ||
{ | ||
depth++; | ||
val >>= 1; | ||
} | ||
|
||
[Benchmark] | ||
public uint PopCount() => Popcnt.PopCount(MaxValue); | ||
return depth; | ||
} | ||
} |
Oops, something went wrong.