Skip to content

Fixes #5310. Add ConfigurationManager / Scheme / Theme benchmark baseline#5312

Open
Copilot wants to merge 4 commits into
developfrom
copilot/add-benchmark-baseline-config-manager
Open

Fixes #5310. Add ConfigurationManager / Scheme / Theme benchmark baseline#5312
Copilot wants to merge 4 commits into
developfrom
copilot/add-benchmark-baseline-config-manager

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

  • Understand existing benchmark infrastructure and configuration/scheme/theme code
  • Create Tests/Benchmarks/Configuration/ConfigurationManagerLoadBenchmark.cs
  • Create Tests/Benchmarks/Configuration/ThemeSwitchBenchmark.cs
  • Create Tests/Benchmarks/Configuration/SchemeAttributeBenchmark.cs
  • Create Tests/Benchmarks/Configuration/SchemeSerializationBenchmark.cs
  • Update Tests/Benchmarks/baseline.json with placeholder entries for all new benchmark triples
  • Update Tests/Benchmarks/README.md to document Configuration benchmarks and update CI references
  • Update .github/workflows/perf-gate.yml to include *Config*, *Scheme*, *Theme* filters
  • Verify benchmarks compile and are listed by BenchmarkDotNet
  • Fix CI: restore local_packages/ and .gitignore to original state

Copilot AI assigned Copilot and tig May 15, 2026
Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
5 tasks
Copilot AI and others added 2 commits May 15, 2026 18:47
Adds four BenchmarkDotNet benchmarks under Tests/Benchmarks/Configuration/:
- ConfigurationManagerLoadBenchmark: cold-start config load + apply
- ThemeSwitchBenchmark: parametric theme switching over all built-in themes
- SchemeAttributeBenchmark: GetAttributeForRole at different derivation depths
- SchemeSerializationBenchmark: JSON serialize/deserialize round-trip

Updates baseline.json with placeholder entries, broadens perf-gate.yml filter
to include the new benchmarks, and documents them in README.md.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/2c601698-792a-447a-889f-2818e993485b

Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ConfigurationManager, Scheme, and Theme benchmark baseline Fixes #5310. Add ConfigurationManager / Scheme / Theme benchmark baseline May 15, 2026
Copilot finished work on behalf of tig May 15, 2026 18:48
Copilot AI requested a review from tig May 15, 2026 18:48
@tig tig marked this pull request as ready for review May 15, 2026 19:11
Copy link
Copy Markdown

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

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: 8c099fb31f

ℹ️ 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".

Comment thread .gitignore Outdated
.mcp.json
.env
tmpclaude-*-cwd
local_packages/
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 Keep local_packages artifacts tracked for debug test runs

Adding local_packages/ to .gitignore while deleting the committed .nupkg/.snupkg files makes fresh checkouts fail the existing LocalPackagesTests (they require that folder plus at least one package file). In the checked workflows (.github/workflows/unit-tests.yml), CI runs dotnet build --no-restore with the default Debug configuration, but CopyNuGetPackagesToLocalPackagesFolder in Terminal.Gui.csproj only runs for Release, so Debug jobs do not recreate local_packages before tests.

Useful? React with 👍 / 👎.

Comment on lines +22 to +25
[IterationSetup]
public void IterationSetup ()
{
ConfigurationManager.Disable (true);
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 Reset ConfigurationManager before each benchmark invocation

This benchmark claims to measure cold-start load/apply, but [IterationSetup] runs only once per iteration while BenchmarkDotNet executes the benchmark method many times per iteration. After the first invocation, ConfigurationManager.Enable(...) short-circuits because it is already enabled, so most samples measure a warm Apply() path instead of the documented cold-start path, skewing the baseline used by the perf gate.

Useful? React with 👍 / 👎.

Comment on lines +50 to +55
[IterationSetup]
public void IterationSetup ()
{
ThemeManager.Theme = ThemeManager.DEFAULT_THEME_NAME;
ConfigurationManager.Apply ();
}
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 Reinitialize theme state before each measured invocation

Using [IterationSetup] here means the theme is reset to Default only once per iteration, but SwitchTheme() is invoked repeatedly inside that iteration. As a result, only the first call performs an actual switch; subsequent calls mostly reapply the same theme value, so the benchmark under-represents real theme-switch cost and can produce misleading perf-gate baselines.

Useful? React with 👍 / 👎.

@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot ci cd is failing.

Reverts the accidental removal of local_packages/ directory and
the .gitignore addition that caused LocalPackagesTests to fail.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/8b9c42d7-30b6-4dc2-96ed-15c5f157582c

Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot ci cd is failing.

The CI failures were caused by my second commit accidentally removing the local_packages/ directory and adding it to .gitignore, which broke the LocalPackagesTests (NupkgFilesExist, SnupkgFilesExist, LocalPackagesFolderExists). Fixed in 0ae15fe by restoring both local_packages/ and .gitignore to their original state.

Copilot finished work on behalf of tig May 15, 2026 19:22
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.

Add ConfigurationManager / Scheme / Theme benchmark baseline

2 participants