Skip to content

LT-22069: Speed up cross-project link navigation#969

Merged
mark-sil merged 1 commit into
mainfrom
LT-22069-cross-project-link-perf
Jun 25, 2026
Merged

LT-22069: Speed up cross-project link navigation#969
mark-sil merged 1 commit into
mainfrom
LT-22069-cross-project-link-perf

Conversation

@mark-sil

@mark-sil mark-sil commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Clicking a cross-project hyperlink (e.g. FLExTrans links between two FLEx projects) took several seconds to bring the target project to the fore, with most of the time spent in .NET Remoting setup rather than the actual jump.

Root cause: CreateRequestor connected to other FieldWorks processes via tcp://localhost:<port>/.... Resolving localhost tries IPv6 (::1) first and waits ~2s for it to fail before falling back to IPv4. That stall is paid once per first-contact to each other FieldWorks process's remoting port. A link relay scans those ports three times during startup (the update check, the single-process-mode check, and the actual handoff), so the cost grows by ~2s for every additional FieldWorks instance running.

Fix: connect to the IPv4 loopback literal 127.0.0.1 instead of localhost.

Measurements

Measured with the German/Swedish FLExTrans sample projects (Debug x64), varying the number of FieldWorks instances open. Diagnosed with temporary cross-process timing markers (since removed); SLDR init (3 ms) and the jump itself (25 ms) were not the bottleneck.

Case 2 — target project already open (end-to-end click cost):

FieldWorks instances open Before After
2 4,953 ms 1,448 ms
3 6,967 ms 1,426 ms
4 9,056 ms 1,432 ms
5 11,269 ms 1,405 ms

Case 1 — target project not yet open (time to target window):

FieldWorks instances open Before After
1 5,702 ms 3,654 ms
3 9,637 ms 3,765 ms
5 14,219 ms 3,444 ms

Before the fix the cost scaled linearly at ~2.1 s per running instance; after the fix it is flat regardless of how many instances are open. This also speeds up normal multi-instance startup and cold cross-project opens, which run the same probes. The remaining Case 1 time is project loading, which this change does not affect.

Relationship to the reported times

The original report cited ~21 s (Case 1) and ~10 s (Case 2). We could not confirm how many FieldWorks sessions the reporter had open at the time, so this is our best guess — but it is the most likely explanation, because we were only able to reproduce times of that magnitude with several (~4–5) FieldWorks sessions running simultaneously. With the fix, those times become flat/low regardless of session count.

Testing

  • Built Debug x64 (build.ps1 -SkipNative).
  • Reproduced the cross-project link scenario by replaying the stored silfw: link against the target project; confirmed the timings above and that target windows / jump behavior are unchanged.

🤖 Generated with Claude Code


This change is Reviewable

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   10m 31s ⏱️ +17s
4 294 tests ±0  4 221 ✅ ±0  73 💤 ±0  0 ❌ ±0 
4 303 runs  ±0  4 230 ✅ ±0  73 💤 ±0  0 ❌ ±0 

Results for commit 3f9187f. ± Comparison against base commit 20eaf74.

♻️ This comment has been updated with latest results.

@jasonleenaylor jasonleenaylor 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.

:lgtm:

@jasonleenaylor reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on mark-sil).

Clicking a cross-project hyperlink (e.g. FLExTrans links between two FLEx
projects) took several seconds to bring the target project to the fore,
with most of the time spent in .NET Remoting setup rather than the actual
jump.

Root cause: CreateRequestor connected to other FieldWorks processes via
"tcp://localhost:<port>/...". Resolving "localhost" tries IPv6 (::1) first
and waits ~2s for it to fail before falling back to IPv4. That stall is
paid once per first-contact to each other FieldWorks process's remoting
port. A link relay scans those ports three times during startup (the
update check, the single-process-mode check, and the actual handoff), so
the cost grows by ~2s for every additional FieldWorks instance running.

Fix: connect to the IPv4 loopback literal 127.0.0.1 instead of "localhost".

Measured with the German/Swedish FLExTrans sample projects (Debug x64),
varying the number of FieldWorks instances open. The per-instance ~2s cost
disappears and timing becomes flat:

  Case 2 (target already open) - end-to-end click cost:
    instances | before  | after
        2     |  4953ms | 1448ms
        3     |  6967ms | 1426ms
        4     |  9056ms | 1432ms
        5     | 11269ms | 1405ms

  Case 1 (target not yet open) - time to target window:
    instances | before  | after
        1     |  5702ms | 3654ms
        3     |  9637ms | 3765ms
        5     | 14219ms | 3444ms

Before the fix the cost scaled linearly at ~2.1s per running instance;
after the fix it is flat regardless of how many instances are open. This
also speeds up normal multi-instance startup and cold cross-project opens,
which run the same probes. The remaining Case 1 time is project loading,
which this change does not affect.

The original report cited ~21s (Case 1) and ~10s (Case 2). We could not
confirm how many FieldWorks sessions the reporter had open at the time, so
this is a best guess - but it is the most likely explanation, since we
could only reproduce times of that magnitude with several (~4-5)
FieldWorks sessions running simultaneously.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mark-sil mark-sil force-pushed the LT-22069-cross-project-link-perf branch from d124f65 to 3f9187f Compare June 25, 2026 19:11
@mark-sil mark-sil merged commit cf8d588 into main Jun 25, 2026
6 of 7 checks passed
@mark-sil mark-sil deleted the LT-22069-cross-project-link-perf branch June 25, 2026 19:25
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