Skip to content

Upgrade nuget package used in benchmark - #112

Merged
prozolic merged 1 commit into
mainfrom
benchmark
Jul 25, 2026
Merged

Upgrade nuget package used in benchmark#112
prozolic merged 1 commit into
mainfrom
benchmark

Conversation

@prozolic

Copy link
Copy Markdown
Owner

This PR upgrades nuget package used in sandbox/Benchmark project.

Copilot AI review requested due to automatic review settings July 25, 2026 13:19
@prozolic
prozolic merged commit 59217e3 into main Jul 25, 2026
2 checks passed
@prozolic
prozolic deleted the benchmark branch July 25, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the sandbox/Benchmark project to use newer NuGet packages (notably Tomlyn and CsToml), and adjusts benchmark code to align with the updated Tomlyn APIs and new benchmark scenarios.

Changes:

  • Upgraded Tomlyn package version and bumped CsToml package references used under the NuGetCsToml configuration.
  • Updated Tomlyn benchmark calls to use TomlSerializer APIs, and added a Tomlyn source-generator context for AOT/trimming-friendly benchmarks.
  • Added a dedicated CsToml “from UTF-8 bytes” parse benchmark path and changed benchmark run preset from ShortRun to MediumRun.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sandbox/Benchmark/Program.cs Updates the debug-time quick run to invoke the new UTF-8 parse benchmark method.
sandbox/Benchmark/Model/Model.cs Introduces a Tomlyn source-generator context configured for snake_case naming.
sandbox/Benchmark/Config/BenchmarkConfig.cs Switches benchmark jobs from ShortRun to MediumRun (affects runtime/throughput).
sandbox/Benchmark/Benchmark/ParseBenchmark.cs Adds cached UTF-8 input and updates Tomlyn parse benchmarks to TomlSerializer.Deserialize.
sandbox/Benchmark/Benchmark/ClassSerializationBenchmark.cs Adds Tomlyn reflection options and a new source-generator serialization benchmark.
sandbox/Benchmark/Benchmark/ClassDeserializationBenchmark.cs Adds Tomlyn reflection options and a new source-generator deserialization benchmark.
sandbox/Benchmark/Benchmark.csproj Upgrades Tomlyn package and updates CsToml package versions used for the NuGet-based benchmark job.
Comments suppressed due to low confidence (13)

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:111

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:163

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly. Also, the local name 'document' is misleading since the type is TomlTable.
        var document = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;
        return document;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:217

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:271

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:325

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:376

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:427

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:478

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:532

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:588

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:641

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ParseBenchmark.cs:693

  • TomlSerializer.Deserialize() returns a nullable reference; using the null-forgiving operator here can hide parse failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var table = TomlSerializer.Deserialize<Tomlyn.Model.TomlTable>(tomlUtf16Text)!;

sandbox/Benchmark/Benchmark/ClassDeserializationBenchmark.cs:105

  • TomlSerializer.Deserialize(...) returns a nullable reference; using the null-forgiving operator here can hide failures and can result in returning null from a method that declares a non-null return type. Prefer throwing (or otherwise handling) the null case explicitly.
        var obj = TomlSerializer.Deserialize(tomlUtf16TextInSnakeCase, TomlynContext.Default.TestTomlSerializedObjectInSnakeCase)!; // Tomlyn (source generator)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sandbox/Benchmark/Benchmark/ParseBenchmark.cs
Comment thread sandbox/Benchmark/Benchmark/ClassDeserializationBenchmark.cs
Comment thread sandbox/Benchmark/Benchmark/ClassSerializationBenchmark.cs
Comment thread sandbox/Benchmark/Config/BenchmarkConfig.cs
@prozolic prozolic mentioned this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants