microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.35k stars 8.29k forks source link

Peformance Issue: Too many ssh profiles makes the settings panel laggy. #15024

Open MichaelSuen-thePointer opened 1 year ago

MichaelSuen-thePointer commented 1 year ago

Windows Terminal version

1.16.10261.0

Windows build number

10.0.19042.1110

Other Software

No response

Steps to reproduce

I have to manage a server cluster with about 5900 machines. I script-generated settings.json with all this 5900 ssh profiles for every machine. And group them by using "actions">"commands" in settings.json Which causes the 'V' button response laggy and settings panel unable to open (whole program hangs).

Its not a rare use case I think. Hope you can optimize this senario.

Sample settings.json, to reproduce this issue, you need manually generate settings.json with that many profiles, below is the sample.

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{92a35041-2568-427d-8e9d-c0fffbe6d951}",
    "copyOnSelect": true,
    "multiLinePasteWarning": false,
    "copyFormatting": false,
    "profiles": {
        "defaults": {
            // Put settings here that you want to apply to all profiles.
            "suppressApplicationTitle": true
        },
        "list": [
            {
                "commandline": "ssh user@group1-host1",
                "guid": "{b8b31d11-bddb-4495-9dc0-aea26abd0a82}",
                "name": "group1-host1-user"
            },
            {
                "commandline": "ssh user@group1-host2",
                "guid": "{b8b31d11-bddb-4495-9dc0-aea26abd0a83}",
                "name": "group1-host2-user"
            },
            {
                "commandline": "ssh user@group1-host3",
                "guid": "{b8b31d11-bddb-4495-9dc0-aea26abd0a84}",
                "name": "group1-host3-user"
            }
            //omit the rest 5897 profiles
        ]
    },
    "actions": [
        {
            "commands": [
                {
                    "command": {
                        "action": "newTab",
                        "profile": "{b8b31d11-bddb-4495-9dc0-aea26abd0a82}"
                    },
                    "name": "host1-user"
                },
                {
                    "command": {
                        "action": "newTab",
                        "profile": "{b8b31d11-bddb-4495-9dc0-aea26abd0a83}"
                    },
                    "name": "host2-user"
                },
                {
                    "command": {
                        "action": "newTab",
                        "profile": "{b8b31d11-bddb-4495-9dc0-aea26abd0a84}"
                    },
                    "name": "host3-user"
                }
            ],
            "name": "group1"
        }
        //omit the rest groups
    ]
}

Expected Behavior

Not laggy, 5900 is not a huge number to be honest.

Actual Behavior

Laggy V button, settings UI unable to open.

lhecker commented 1 year ago

Not laggy, 5900 is not a huge number to be honest.

image

It seems like 5899 profiles is the limit then. 😄

But in all seriousness, yes, I agree, it should be performant. There's no reason why it should be worse than O(n) and n=5900 for anything is not that much. 🙂