From 3f9187fb2becf780aa2fa3aab76df6e13ea64e5f Mon Sep 17 00:00:00 2001 From: mark-sil <83427558+mark-sil@users.noreply.github.com> Date: Thu, 25 Jun 2026 13:48:41 -0400 Subject: [PATCH] LT-22069: Speed up cross-project link navigation 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:/...". 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 --- Src/Common/FieldWorks/FieldWorks.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Src/Common/FieldWorks/FieldWorks.cs b/Src/Common/FieldWorks/FieldWorks.cs index 67fcbc2136..3680193fb8 100644 --- a/Src/Common/FieldWorks/FieldWorks.cs +++ b/Src/Common/FieldWorks/FieldWorks.cs @@ -3484,8 +3484,12 @@ internal static bool RunOnRemoteClients(string requestType, Func invoker = requestor.IsAlive; IAsyncResult ar = invoker.BeginInvoke(null, null); if (!ar.AsyncWaitHandle.WaitOne(1000, false))