mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Greatly speed up 'attach to running instance' dialog in the 99% case
* 99% of the time, you'll only have localhost and the application will be running on the first ident checked which will return a valid socket almost immediately. * Instead of continuing to search through each valid port before returning valid data, we change the enumerate function to just find the next valid port and return - so we can update the UI as soon as we have the first result.
This commit is contained in:
@@ -69,29 +69,25 @@ namespace renderdocui.Windows.Dialogs
|
||||
|
||||
var updateThread = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
var idents = renderdoc.StaticExports.EnumerateRemoteConnections("localhost");
|
||||
|
||||
string runningPrograms = "";
|
||||
int running = 0;
|
||||
foreach (var i in idents)
|
||||
|
||||
renderdoc.StaticExports.EnumerateRemoteConnections("localhost", (UInt32 i) =>
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
running++;
|
||||
running++;
|
||||
|
||||
var conn = renderdoc.StaticExports.CreateRemoteAccessConnection("localhost", i, "updater", false);
|
||||
var conn = renderdoc.StaticExports.CreateRemoteAccessConnection("localhost", i, "updater", false);
|
||||
|
||||
if (runningPrograms != "")
|
||||
runningPrograms += "\n";
|
||||
if (runningPrograms != "")
|
||||
runningPrograms += "\n";
|
||||
|
||||
if (conn.API != "")
|
||||
runningPrograms += String.Format("{0} running {1}", conn.Target, conn.API);
|
||||
else
|
||||
runningPrograms += conn.Target;
|
||||
if (conn.API != "")
|
||||
runningPrograms += String.Format("{0} running {1}", conn.Target, conn.API);
|
||||
else
|
||||
runningPrograms += conn.Target;
|
||||
|
||||
conn.Shutdown();
|
||||
}
|
||||
}
|
||||
conn.Shutdown();
|
||||
});
|
||||
|
||||
if (running > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user