Skip to content

Commit

Permalink
Merge pull request #156 from corvus-dotnet/feature/highperf-fix
Browse files Browse the repository at this point in the history
Use Corvus.HighPerformance
  • Loading branch information
idg10 authored Sep 3, 2024
2 parents f877064 + 0be88a8 commit 382fb66
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 391 deletions.
85 changes: 53 additions & 32 deletions Solutions/Corvus.UriTemplate.Benchmarking/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
},
"Endjin.RecommendedPractices.GitHub": {
"type": "Direct",
"requested": "[2.1.7, )",
"resolved": "2.1.7",
"contentHash": "7xiydtNIy4sM0c4C/GF/QRXukgVLuWf76VoPQuT0ShLpSeZSfzcmYpAniJrBUyEZp1GT32qQY0kPGTTGPOsISg==",
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "JEOlUQymdvrI6OeVHPTpakLhOJvkLdvmH+wJNNdjqSq3FtZ2LnqKei+4AMFUzTdJcL6RF3KGD3x0AqUfhYgWcw==",
"dependencies": {
"Endjin.RecommendedPractices": "2.1.7",
"Endjin.RecommendedPractices": "2.1.12",
"Microsoft.SourceLink.GitHub": "1.1.1"
}
},
Expand All @@ -56,17 +56,17 @@
},
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.6.1, )",
"resolved": "4.6.1",
"contentHash": "SDnYINWUo4n7/OsU2+ygeYexLWZ7KoMIfuNVY4V0S7ANVNHeg9YgEpK7G0zlTJmvWdIuoc0A85zZoyIyRj+Tag=="
"requested": "[4.12.3, )",
"resolved": "4.12.3",
"contentHash": "6+O9GwAxOxJr1rZ4aaLiBiSH3pxDkJuXLE8qjo/JXLvGkZhKRLbAz30WA32RmJb5Nn1TmjZ2T3kWt3GJmEDj1w=="
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.507, )",
"resolved": "1.2.0-beta.507",
"contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==",
"requested": "[1.2.0-beta.556, )",
"resolved": "1.2.0-beta.556",
"contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.507"
"StyleCop.Analyzers.Unstable": "1.2.0.556"
}
},
"Tavis.UriTemplates": {
Expand Down Expand Up @@ -96,10 +96,20 @@
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"Corvus.HighPerformance": {
"type": "Transitive",
"resolved": "0.2.0",
"contentHash": "ZYYx9P1cCMBazWkUqr5YDfZZPJ89ZBqeNEkQBxOjRZjRA5YGK2IVbEEXhC+go+5ffjl2zrT5C+B+BLaL5IYkrQ==",
"dependencies": {
"IndexRange": "1.0.3",
"System.Buffers": "4.5.1",
"System.Memory": "4.5.5"
}
},
"Endjin.RecommendedPractices": {
"type": "Transitive",
"resolved": "2.1.7",
"contentHash": "NfTX2efpxMsDrRwQ8ykmLpVGBJfRF6xLeMl5r36SKOKsD1xjvlIDNm/SGR7fsjbKITQkjvmaUuNQkBDcH6EGIA==",
"resolved": "2.1.12",
"contentHash": "OZObdtlvF6isizGzO0Vydwmj2IR8GxydcTMGCoA9lmejnlCRWYPuyJXr3ULknlJ23hHDkyLFnu/xNA4duMr2SQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1"
}
Expand Down Expand Up @@ -305,8 +315,8 @@
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
"contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw=="
"resolved": "1.2.0.556",
"contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ=="
},
"System.Buffers": {
"type": "Transitive",
Expand Down Expand Up @@ -432,6 +442,7 @@
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.2.2, )",
"Corvus.HighPerformance": "[0.2.0, )",
"IndexRange": "[1.0.3, )",
"Microsoft.Extensions.ObjectPool": "[8.0.0, )",
"System.Buffers": "[4.5.1, )",
Expand Down Expand Up @@ -538,27 +549,27 @@
},
"Endjin.RecommendedPractices.GitHub": {
"type": "Direct",
"requested": "[2.1.7, )",
"resolved": "2.1.7",
"contentHash": "7xiydtNIy4sM0c4C/GF/QRXukgVLuWf76VoPQuT0ShLpSeZSfzcmYpAniJrBUyEZp1GT32qQY0kPGTTGPOsISg==",
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "JEOlUQymdvrI6OeVHPTpakLhOJvkLdvmH+wJNNdjqSq3FtZ2LnqKei+4AMFUzTdJcL6RF3KGD3x0AqUfhYgWcw==",
"dependencies": {
"Endjin.RecommendedPractices": "2.1.7",
"Endjin.RecommendedPractices": "2.1.12",
"Microsoft.SourceLink.GitHub": "1.1.1"
}
},
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.6.1, )",
"resolved": "4.6.1",
"contentHash": "SDnYINWUo4n7/OsU2+ygeYexLWZ7KoMIfuNVY4V0S7ANVNHeg9YgEpK7G0zlTJmvWdIuoc0A85zZoyIyRj+Tag=="
"requested": "[4.12.3, )",
"resolved": "4.12.3",
"contentHash": "6+O9GwAxOxJr1rZ4aaLiBiSH3pxDkJuXLE8qjo/JXLvGkZhKRLbAz30WA32RmJb5Nn1TmjZ2T3kWt3GJmEDj1w=="
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.507, )",
"resolved": "1.2.0-beta.507",
"contentHash": "/FtugDT66cKJJ+GGH7rNpG6UDrT4iIWz45M6lrXXHobDUFDHw+q5VgkbiR+6ffTO564ge7w6fQh/eoQhVdJO8Q==",
"requested": "[1.2.0-beta.556, )",
"resolved": "1.2.0-beta.556",
"contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.507"
"StyleCop.Analyzers.Unstable": "1.2.0.556"
}
},
"Tavis.UriTemplates": {
Expand All @@ -582,10 +593,19 @@
"resolved": "8.2.2",
"contentHash": "+zIp8d3sbtYaRbM6hqDs4Ui/z34j7DcUmleruZlYLE4CVxXq+MO8XJyIs42vzeTYFX+k0Iq1dEbBUnQ4z/Gnrw=="
},
"Corvus.HighPerformance": {
"type": "Transitive",
"resolved": "0.2.0",
"contentHash": "ZYYx9P1cCMBazWkUqr5YDfZZPJ89ZBqeNEkQBxOjRZjRA5YGK2IVbEEXhC+go+5ffjl2zrT5C+B+BLaL5IYkrQ==",
"dependencies": {
"System.Buffers": "4.5.1",
"System.Memory": "4.5.5"
}
},
"Endjin.RecommendedPractices": {
"type": "Transitive",
"resolved": "2.1.7",
"contentHash": "NfTX2efpxMsDrRwQ8ykmLpVGBJfRF6xLeMl5r36SKOKsD1xjvlIDNm/SGR7fsjbKITQkjvmaUuNQkBDcH6EGIA==",
"resolved": "2.1.12",
"contentHash": "OZObdtlvF6isizGzO0Vydwmj2IR8GxydcTMGCoA9lmejnlCRWYPuyJXr3ULknlJ23hHDkyLFnu/xNA4duMr2SQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1"
}
Expand Down Expand Up @@ -775,8 +795,8 @@
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.507",
"contentHash": "gTY3IQdRqDJ4hbhSA3e/R48oE8b/OiKfvwkt1QdNVfrJK2gMHBV8ldaHJ885jxWZfllK66soa/sdcjh9bX49Tw=="
"resolved": "1.2.0.556",
"contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ=="
},
"System.Buffers": {
"type": "Transitive",
Expand Down Expand Up @@ -805,8 +825,8 @@
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw=="
},
"System.Reflection.Metadata": {
"type": "Transitive",
Expand Down Expand Up @@ -863,6 +883,7 @@
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.2.2, )",
"Corvus.HighPerformance": "[0.2.0, )",
"Microsoft.Extensions.ObjectPool": "[8.0.0, )",
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[8.0.0, )"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;

using CommunityToolkit.HighPerformance;

using Corvus.UriTemplates.Internal;
using Corvus.HighPerformance;
using Corvus.UriTemplates.TemplateParameterProviders;

namespace Corvus.UriTemplates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System.Runtime.CompilerServices;

using Corvus.UriTemplates.Internal;
using Corvus.HighPerformance;

namespace Corvus.UriTemplates;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using System.Text.Json;

using Corvus.UriTemplates.Internal;
using Corvus.HighPerformance;
using Corvus.UriTemplates.TemplateParameterProviders;

namespace Corvus.UriTemplates;
Expand Down Expand Up @@ -268,7 +268,7 @@ private static bool ProcessString(ReadOnlySpan<char> span, in AppendValueState s
{
ValueStringBuilder output = new(span.Length * 2);
WriteStringValue(ref output, span, state.PrefixLength, state.AllowReserved);
result = new(output.RentedChars, output.Length);
result = new(output.GetRentedBuffer(), output.Length);

// Do not dispose the value string builder, we have borrowed its innards
return true;
Expand All @@ -292,7 +292,7 @@ private static bool ProcessString(ReadOnlySpan<char> span, in AppendNameAndValue

WriteStringValue(ref output, span, state.PrefixLength, state.AllowReserved);

result = new(output.RentedChars, output.Length);
result = new(output.GetRentedBuffer(), output.Length);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.CompilerServices;
using System.Text.Json;

using Corvus.UriTemplates.Internal;
using Corvus.HighPerformance;

namespace Corvus.UriTemplates;

Expand Down
5 changes: 3 additions & 2 deletions Solutions/Corvus.UriTemplates/Corvus.UriTemplates.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(EndjinProjectPropsPath)" Condition="$(EndjinProjectPropsPath) != ''" />

<PropertyGroup>
Expand All @@ -22,7 +22,8 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.2.2" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.12">
<PackageReference Include="Corvus.HighPerformance" Version="0.2.0" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.12">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit 382fb66

Please sign in to comment.