Skip to content

[Fix] dotnet worker latency - #757

Merged
Power-Maverick merged 2 commits into
PowerPlatformToolBox:devfrom
MarkMpn:fix/dotnet-worker-latency
Oct 26, 2026
Merged

Power-Maverick merged 2 commits into
PowerPlatformToolBox:devfrom
MarkMpn:fix/dotnet-worker-latency

Conversation

@MarkMpn

@MarkMpn MarkMpn commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The fingerprint of the dotnet worker was being recalculated multiple times on each message send and response received, adding significant latency. On a simple SQL 4 CDS query this was adding around 2 seconds to a query which would normally execute in around 0.2 seconds.

This change limits the fingerprint checks to the initial consent and process start points. Once the process has started and the RPC client is attached to its stdin/out streams, only basic checks are performed on each message to keep performance at a usable level.

Fixes #756

Type of change

  • New feature
  • Bug fix
  • Refactor (no functional change)
  • Documentation
  • Chore / maintenance (dependency update, build, config)
  • Test addition / improvement

Changes

In workerBrokerManager.ts, split the check() method into two. check() preserves only the lightweight checks to ensure the tool is still alive and consent has not been revoked. The heavier checks for fingerprint validation are split into checkSource() which is invoked only when consent is being granted and the tool process is being started.

Architecture checklist

Packages (types & validation)

  • Not applicable — no changes to packages/

Code quality

  • pnpm run typecheck passes with 0 errors (warnings are acceptable)
  • pnpm run lint passes with 0 errors (warnings are acceptable)
  • pnpm run build completes successfully

Testing

  • pnpm run test:unit passes (for changes to src/main/, src/common/, or src/renderer/ utilities)
  • pnpm run test:e2e passes (for UI / navigation / end-to-end flows)
  • Manually tested in the running app (pnpm run dev)

Scenario tested:

  • Added temporary logging throughout the worker IPC pipeline to identify where the additional time was being spent and ensured that the expensive fingerprinting step was run only during the startup phase after the change.
  • Ran with my local SQL 4 CDS tool and verified that results from query execution were returned in times comparable with XrmToolBox version.

Breaking changes

  • No breaking changes
  • Yes — describe impact and migration path below:

Reviewer notes

  • I have added appropriate unit and/or e2e tests for this change
  • I have resolved all GitHub Copilot review comments
  • I have followed the guidelines in CONTRIBUTING.md

@MarkMpn MarkMpn changed the title [Fix]: dotnet worker latency [Fix] dotnet worker latency Oct 25, 2026
@Power-Maverick
Power-Maverick merged commit 22d0662 into PowerPlatformToolBox:dev Oct 26, 2026
8 of 10 checks passed
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.

[Bug]: dotnet workers have high overhead on each message

2 participants