Skip to content

Commit

Permalink
Merge b7bd7c5 into 860fc55
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDawson authored Sep 28, 2022
2 parents 860fc55 + b7bd7c5 commit be5f548
Show file tree
Hide file tree
Showing 25 changed files with 1,842 additions and 159 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,5 @@ coverage.cobertura.xml

# Scripted build artifacts
/_codeCoverage
/_packages
/_packages
*.sbom.*
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Corvus.UriTemplates.Resolvers.Json\Corvus.UriTemplates.Resolvers.Json.csproj" />
<ProjectReference Include="..\Corvus.UriTemplates\Corvus.UriTemplates.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.2" />
<PackageReference Include="Corvus.Json.ExtendedTypes" Version="1.0.0-v1-pre1.174" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Copyright (c) Endjin Limited. All rights reserved.
// </copyright>

using System.Text.Json;
using BenchmarkDotNet.Attributes;
using Corvus.Json;

namespace Corvus.UriTemplates.Benchmarking;

Expand All @@ -15,8 +15,8 @@ public class UriTemplateParameterSetting
{
private const string UriTemplate = "http://example.org/location{?value*}";
private static readonly Dictionary<string, string> Values = new() { { "foo", "bar" }, { "bar", "baz" }, { "baz", "bob" } };
private static readonly JsonAny JsonValues = JsonAny.FromProperties(("foo", "bar"), ("bar", "baz"), ("baz", "bob")).AsJsonElementBackedValue();

private readonly JsonDocument jsonValues = JsonDocument.Parse("{ \"foo\": \"bar\", \"bar\": \"baz\", \"baz\": \"bob\" }");
private Tavis.UriTemplates.UriTemplate? tavisTemplate;
private TavisApi.UriTemplate? corvusTavisTemplate;

Expand All @@ -39,6 +39,7 @@ public Task GlobalSetup()
[GlobalCleanup]
public Task GlobalCleanup()
{
this.jsonValues.Dispose();
return Task.CompletedTask;
}

Expand Down Expand Up @@ -69,7 +70,7 @@ public void ResolveUriCorvusTavis()
public void ResolveUriCorvus()
{
object? nullState = default;
JsonUriTemplateResolver.TryResolveResult(UriTemplate.AsSpan(), false, JsonValues, HandleResult, ref nullState);
JsonUriTemplateResolver.TryResolveResult(UriTemplate.AsSpan(), false, this.jsonValues.RootElement, HandleResult, ref nullState);
static void HandleResult(ReadOnlySpan<char> resolvedTemplate, ref object? state)
{
// NOP
Expand Down
113 changes: 48 additions & 65 deletions Solutions/Corvus.UriTemplate.Benchmarking/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@
"Microsoft.Diagnostics.Tracing.TraceEvent": "3.0.2"
}
},
"Corvus.Json.ExtendedTypes": {
"type": "Direct",
"requested": "[1.0.0-v1-pre1.174, )",
"resolved": "1.0.0-v1-pre1.174",
"contentHash": "u/bjziXGWKnkIuZgvwTE0/ngpImRLbXThszBUjxqNXZT21JR50lJue1HiHs1Ckw/0oFsTq65n8ijZAmRpxLdGg==",
"dependencies": {
"CommunityToolkit.HighPerformance": "8.0.0",
"Corvus.Extensions": "1.1.4",
"Microsoft.Extensions.Http": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.ObjectPool": "7.0.0-rc.1.22427.2",
"NodaTime": "3.1.2",
"System.Buffers": "4.5.1",
"System.Collections.Immutable": "7.0.0-rc.1.22426.10",
"System.Text.Json": "7.0.0-rc.1.22426.10"
}
},
"Endjin.RecommendedPractices.GitHub": {
"type": "Direct",
"requested": "[2.1.2, )",
Expand Down Expand Up @@ -97,14 +81,6 @@
"resolved": "8.0.0",
"contentHash": "S5Iv1d5UJZNJLJbe/xzJmLqYJ2mhefbLAvhXCZEh3G4sFadUBuQZhQioE4oJG4enY69QMuJX3AX9+6P9rH1bMw=="
},
"Corvus.Extensions": {
"type": "Transitive",
"resolved": "1.1.4",
"contentHash": "WGwNzQDNrlxfH82iRSSXcG92yKhE8xlBMWoSC4dycp0MnH2Mle0TF+Y4keRgDAdDwXg8VC+3paZx64jVG1Jazg==",
"dependencies": {
"System.Interactive": "3.2.0"
}
},
"Endjin.RecommendedPractices": {
"type": "Transitive",
"resolved": "2.1.2",
Expand Down Expand Up @@ -187,45 +163,50 @@
"resolved": "3.1.6",
"contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg=="
},
"Microsoft.Extensions.DependencyInjection": {
"Microsoft.Extensions.Configuration": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "P7COzZFQKK9YzxomJUl9zXOKkt+5JJ4BIwHl/sN7+gHWAGjY9bD3yqV0Vzf5moGahBVrvL7dWyX1AN2MeoL68g==",
"resolved": "2.1.1",
"contentHash": "LjVKO6P2y52c5ZhTLX/w8zc5H4Y3J/LJsgqTBj49TtFq/hAtVNue/WA0F6/7GMY90xhD7K0MDZ4qpOeWXbLvzg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0-rc.1.22426.10"
"Microsoft.Extensions.Configuration.Abstractions": "2.1.1"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"Microsoft.Extensions.Configuration.Abstractions": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "DJfKuxPF9IF1BnFxpEYLLXthLg6QEXopGtxGfuSCc3/fWJdnwPwSCTA6DOl5LHtRHogJlq6haL3Ehh+RNVpW7Q=="
"resolved": "2.1.1",
"contentHash": "VfuZJNa0WUshZ/+8BFZAhwFKiKuu/qOUCFntfdLpHj7vcRnsGHqd3G2Hse78DM+pgozczGM63lGPRLmy+uhUOA==",
"dependencies": {
"Microsoft.Extensions.Primitives": "2.1.1"
}
},
"Microsoft.Extensions.Http": {
"Microsoft.Extensions.Configuration.Binder": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "qcNuBOGM2mu+yAUiqCDoRL6vLcW3vfVze/5QAmfWUIg/duUXd2D4kiLvyXiCt4cNWMS5X2Zw5+tlt8c/MnBq1g==",
"resolved": "2.1.1",
"contentHash": "fcLCTS03poWE4v9tSNBr3pWn0QwGgAn1vzqHXlXgvqZeOc7LvQNzaWcKRQZTdEc3+YhQKwMsOtm3VKSA2aWQ8w==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.Logging": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.Logging.Abstractions": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.Options": "7.0.0-rc.1.22426.10"
"Microsoft.Extensions.Configuration": "2.1.1"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "2.1.1",
"contentHash": "MgYpU5cwZohUMKKg3sbPhvGG+eAZ/59E9UwPwlrUkyXU+PGzqwZg9yyQNjhxuAWmoNoFReoemeCku50prYSGzA=="
},
"Microsoft.Extensions.Logging": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "8RkgzXx5vTJGFd60GBlk5vybpEBUXTxfgcRgQw1uaM2kAjovc/Q5xezT+u58xDsy4rLDfd0pGZ6EisV5GOcy4w==",
"resolved": "2.1.1",
"contentHash": "hh+mkOAQDTp6XH80xJt3+wwYVzkbwYQl9XZRCz4Um0JjP/o7N9vHM3rZ6wwwtr+BBe/L6iBO2sz0px6OWBzqZQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.Logging.Abstractions": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.Options": "7.0.0-rc.1.22426.10"
"Microsoft.Extensions.Configuration.Binder": "2.1.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.1",
"Microsoft.Extensions.Logging.Abstractions": "2.1.1",
"Microsoft.Extensions.Options": "2.1.1"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "ElrDslqtljpyFZTyygITf3VmYEWUE/ZsTaf7jltzbFohp5u51CLQ2OlO0dRSA8CsFqX/Axiu9vMwyUmt8NJo2g=="
"resolved": "2.1.1",
"contentHash": "XRzK7ZF+O6FzdfWrlFTi1Rgj2080ZDsd46vzOjadHUB0Cz5kOvDG8vI7caa5YFrsHQpcfn0DxtjS4E46N4FZsA=="
},
"Microsoft.Extensions.ObjectPool": {
"type": "Transitive",
Expand All @@ -234,17 +215,21 @@
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "DQ0guZczQIwu7kGsKy7072ncZOdbHC8r1bWLbh+/NaL/cVC1mrlK8UA8fQP+trtp2YYfOrfaF0wqffYkRdpQKg==",
"resolved": "2.1.1",
"contentHash": "V7lXCU78lAbzaulCGFKojcCyG8RTJicEbiBkPJjFqiqXwndEBBIehdXRMWEVU3UtzQ1yDvphiWUL9th6/4gJ7w==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0-rc.1.22426.10",
"Microsoft.Extensions.Primitives": "7.0.0-rc.1.22426.10"
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.1",
"Microsoft.Extensions.Primitives": "2.1.1"
}
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "7.0.0-rc.1.22426.10",
"contentHash": "BELLSkZWsX/Y4uNqbCiAnwBH5NnVfMAxs50SXUaV+edkO4rRJdskxHTLMgLCqtnTcy4UnWsERsnj/3zONGlogA=="
"resolved": "2.1.1",
"contentHash": "scJ1GZNIxMmjpENh0UZ8XCQ6vzr/LzeF9WvEA51Ix2OQGAs9WPgPu8ABVUdvpKPLuor/t05gm6menJK3PwqOXg==",
"dependencies": {
"System.Memory": "4.5.1",
"System.Runtime.CompilerServices.Unsafe": "4.5.1"
}
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
Expand Down Expand Up @@ -331,14 +316,6 @@
"System.Xml.XDocument": "4.0.11"
}
},
"NodaTime": {
"type": "Transitive",
"resolved": "3.1.2",
"contentHash": "KAlnzQ2EtrrRhFoVePf2kMc24CXX3mAslfp+LmVQnk6HSZ8whgsHNpfUfO+jWCdMgGKQQKMjNCDgmTopjTPFFA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.7.1"
}
},
"Perfolizer": {
"type": "Transitive",
"resolved": "0.2.1",
Expand Down Expand Up @@ -526,11 +503,6 @@
"System.Runtime.InteropServices": "4.1.0"
}
},
"System.Interactive": {
"type": "Transitive",
"resolved": "3.2.0",
"contentHash": "hoXiC7r+WvT/oQ/QcsCgIJMEcXKXyM26BvIcFVRgEMzXk9URu8oR2ADqrnHwIRiJmxQC/q8b3KTQSkdoFRO4TA=="
},
"System.IO": {
"type": "Transitive",
"resolved": "4.1.0",
Expand Down Expand Up @@ -1154,6 +1126,17 @@
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[7.0.0-rc.1.22426.10, )"
}
},
"corvus.uritemplates.resolvers.json": {
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.0.0, )",
"Corvus.UriTemplates": "[1.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.0-rc.1.22427.2, )",
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[7.0.0-rc.1.22426.10, )",
"System.Text.Json": "[7.0.0-rc.1.22426.10, )"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="azurepipelines.testlogger" Version="1.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(EndjinProjectPropsPath)" Condition="$(EndjinProjectPropsPath) != ''" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Description>JSON parameter provider for a low allocation implementation of URI template functions conforming to http://tools.ietf.org/html/rfc6570.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.0.0" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Collections.Immutable" Version="7.0.0-rc.1.22426.10" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="7.0.0-rc.1.22427.2" />
<PackageReference Include="System.Text.Json" Version="7.0.0-rc.1.22426.10" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Corvus.UriTemplates\Corvus.UriTemplates.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.435" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Roslynator.Analyzers" Version="4.1.1" />
</ItemGroup>

</Project>
Loading

0 comments on commit be5f548

Please sign in to comment.