Skip to content

Benchmark for Core.RemoveObjectFromList() implementation - #499

Merged
jozefizso merged 3 commits into
releases/netoffice_v1.9.11from
dev/448_benchmark_RemoveObjectFromList
Sep 5, 2026
Merged

Benchmark for Core.RemoveObjectFromList() implementation#499
jozefizso merged 3 commits into
releases/netoffice_v1.9.11from
dev/448_benchmark_RemoveObjectFromList

Conversation

@jozefizso

Copy link
Copy Markdown
Member

No description provided.

jozefizso and others added 3 commits April 28, 2026 21:38
```
dotnet run -f net8.0 -c Release -- all
```
Ensures the NetOffice Benchmarks project can be built.
We are not running benchmarks are take too long to finish.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T08:12:09.546564Z e0820de PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jozefizso
jozefizso merged commit e0372b4 into releases/netoffice_v1.9.11 Sep 5, 2026
9 of 11 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in NetOffice Sep 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0820de55e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net48;net8.0;net10.0</TargetFrameworks>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Target frameworks compatible with the referenced NetOffice project

The benchmark project builds net8.0 and net10.0, but its only ProjectReference points to Source/NetOffice/NetOffice.csproj, which targets only net462. Those target graphs cannot resolve a compatible NetOffice asset, so the dotnet build command in .github/workflows/benchmarks.yml fails instead of validating the benchmarks; either restrict this project to a compatible .NET Framework target or make the referenced library available for the modern targets.

Useful? React with 👍 / 👎.


Run all benchmarks:
```bash
cd Tests/NetOffice.Benchmarks

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Specify a framework in every documented run command

Because this project declares multiple target frameworks, dotnet run -c Release cannot choose an executable and exits with NETSDK1129 asking for --framework. This affects the default command and all three argument variants shown below it, so users following the README cannot start any benchmarks until each command supplies a target such as -f net10.0.

Useful? React with 👍 / 👎.

Comment on lines +128 to +129
int key = obj.GetHashCode();
_globalObjectList[key] = obj;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve distinct objects when hash codes collide

When two distinct COM wrappers return the same legal 32-bit hash code, assigning by obj.GetHashCode() overwrites the first wrapper, and subsequently removing either wrapper removes the shared entry. The mock's monotonically unique hash codes hide this semantic failure, so the benchmark can recommend a dictionary variant that would lose objects from Core's disposal tracking; use an identity-safe key rather than treating hash codes as unique IDs.

Useful? React with 👍 / 👎.

/// Simulates disposing a parent with N children.
/// Expected: O(n²) complexity - performance degrades quadratically
/// </summary>
[Benchmark(Baseline = true, Description = "List - Sequential Removal")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Define a List baseline for each benchmark scenario

This is the only baseline in the class, while the class also contains the unrelated bulk-disposal and mixed-operation scenarios without category grouping. BenchmarkDotNet therefore reports every ratio against sequential List removal rather than comparing each HashSet/Dictionary variant with the corresponding List workload, making the ratios for Scenarios B and C misleading; group the scenarios and assign each List method as its group's baseline.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant