Skip to content

MapWinGIS6 – Vector Rendering Performance Improvement Plan - #88

Open
pmeems wants to merge 3 commits into
developmentfrom
perf-baseline-instrumentation
Open

pmeems wants to merge 3 commits into
developmentfrom
perf-baseline-instrumentation

Conversation

@pmeems

@pmeems pmeems commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Motivation

Establish a measured baseline for large-vector loading and initial rendering before changing the scene architecture.

Design

Adds opt-in, thread-safe Core diagnostics consumed by Core and ActiveX, a default-preserving outline-only scene option, and reproducible A-D Release benchmarks. The benchmark reports 205.8 ms of triangulation in a 230.6 ms scene build on 2,459 generated polygons; the first OpenGL frame and glReadPixels are also isolated.

Validation

  • CMake Debug x64 and MSBuild Debug x64 build successfully.
  • 447 non-interactive CTest cases pass; focused diagnostics tests pass.
  • Warning count matches origin/development: 30 pre-existing D9025 warnings, no new compiler warnings.
  • Release benchmark smoke and the 2,459-feature measurement pass.

No new dependencies. No shared-memory changes were needed; durable baseline details are in docs/TESTING.md. OpenGL outline-only rendering remains intentionally deferred to Phase 2.

pmeems and others added 2 commits November 19, 2026 17:44
- Add process-wide opt-in timings and counters across Core and ActiveX
- Benchmark fill-enabled and outline-only GDI/OpenGL configurations
- Document Release results and the remaining OpenGL outline limitation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add all A-D timings for the supplied 10.3 MB shapefile
- Record the dominant pipeline costs and estimated first-display times

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@Julian-MW Julian-MW 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.

Automated review. Final decision is with the human reviewer.

Two minor diagnostics API findings are noted inline. No duplicate findings were found in existing PR comments or review threads.

const PerformanceOperation operation,
const std::chrono::nanoseconds duration) noexcept
{
AtomicPerformanceState& state = State();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: Minor | Confidence: High

Issue: RecordDuration() unconditionally updates the aggregates, even when diagnostics are disabled. Since this method is public, callers can populate the snapshot while IsEnabled() is false, contrary to the opt-in/disabled-by-default contract.

Impact: A consumer that directly records a duration without checking IsEnabled() can contaminate an otherwise disabled or reset diagnostic snapshot.

Fix: Make the public recording method respect the enabled flag, and use a private/internal unconditional recording helper for PerformanceScope so a scope that started enabled retains the documented behavior if diagnostics are disabled before its destruction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 100f372: disabled diagnostics now ignore direct duration recording while scopes that started enabled still record on completion.

std::array<std::int64_t, PerformanceCounterCount> counters{};

[[nodiscard]] const PerformanceTiming& Timing(PerformanceOperation operation) const noexcept;
[[nodiscard]] std::int64_t Counter(PerformanceCounter counter) const noexcept;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: Suggestion | Confidence: High

Issue: PerformanceSnapshot::Counter() is a non-void query but lacks [[nodiscard]], unlike the other query methods in this diagnostics API.

Impact: Callers can accidentally discard the counter value without a compiler warning, and this is inconsistent with the repository's API coding standard.

Fix: Add [[nodiscard]] to this declaration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not changed: PerformanceSnapshot::Counter() already has [[nodiscard]] on PR HEAD (PerformanceDiagnostics.h line 70).

- Prevent public duration recording while diagnostics are disabled`n- Preserve completion timing for scopes that started enabled

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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