Skip to content

Commit

Permalink
Update packages and SpanWriter (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescourtney authored Feb 25, 2024
1 parent 21695cc commit 8c8510b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/Benchmarks/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
Expand Down
4 changes: 2 additions & 2 deletions src/Benchmarks/BenchmarkOld/BenchmarkOld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="FlatSharp.Compiler" Version="7.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/FlatSharp.Runtime/GeneratedSerializerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ item is IFlatBufferDeserializedObject deserializedObj &&
Debug.Assert(!sharedStringWriter.IsDirty);
}

writer.InvokeWrite(this.innerSerializer, destination, item, serializationContext);
this.innerSerializer.Write(writer, destination, item, serializationContext);

if (sharedStringWriter?.IsDirty == true)
{
Expand Down
15 changes: 0 additions & 15 deletions src/FlatSharp.Runtime/IO/ISpanWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,6 @@ public interface ISpanWriter
/// </summary>
int GetStringBytes(Span<byte> destination, string value, Encoding encoding);

/// <summary>
/// Invokes the <see cref="IGeneratedSerializer{T}.Write{TSpanWriter}(TSpanWriter, Span{byte}, T, SerializationContext)"/>
/// method using the type information for this serializer.
/// </summary>
/// <remarks>
/// IGeneratedSerializer is a generic interface that accepts a SpanWriter. However, with precise type information,
/// it is possible for SpanWriter instances to avoid vtable indirection when wrapped in a struct or passed as a struct. This
/// hook allows SpanWriter implementations to invoke the generated serializer in an efficient way.
/// </remarks>
void InvokeWrite<TItemType>(
IGeneratedSerializer<TItemType> serializer,
Span<byte> destination,
TItemType item,
SerializationContext context);

/// <summary>
/// Invokes the <see cref="ISharedStringWriter.FlushWrites{TSpanWriter}(TSpanWriter, Span{byte}, SerializationContext)"/> method.
/// </summary>
Expand Down
9 changes: 0 additions & 9 deletions src/FlatSharp.Runtime/IO/SpanWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ public int GetStringBytes(Span<byte> destination, string value, Encoding encodin
return bytesWritten;
}

public void InvokeWrite<TItemType>(IGeneratedSerializer<TItemType> serializer, Span<byte> destination, TItemType item, SerializationContext context)
{
serializer.Write(
this,
destination,
item,
context);
}

public void FlushSharedStrings(ISharedStringWriter writer, Span<byte> destination, SerializationContext context)
{
writer.FlushWrites(this, destination, context);
Expand Down
4 changes: 1 addition & 3 deletions src/FlatSharp/FlatSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
<ItemGroup>
<ProjectReference Include="..\FlatSharp.Runtime\FlatSharp.Runtime.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>

<ItemGroup>
<Compile Update="TypeModel\ScalarTypeModels.cs">
<DesignTime>True</DesignTime>
Expand Down
10 changes: 4 additions & 6 deletions src/Tests/FlatSharpCompilerTests/FlatSharpCompilerTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Grpc.Core" Version="2.46.6" />
<PackageReference Include="Grpc.Core.Api" Version="2.59.0" />
<PackageReference Include="Grpc.Core.Api" Version="2.61.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

Expand All @@ -25,11 +25,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Microsoft.TestPlatform.ObjectModel" Version="17.8.0" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.utility" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PackageReference Update="xunit" Version="2.7.0" />
<PackageReference Update="xunit.runner.utility" Version="2.7.0" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 8c8510b

Please sign in to comment.