_ReorderProfilesToMatchUserSettingsOrder could almost certainly not be O(N^2) #3829

Open
opened 2026-01-30 23:30:58 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (Sep 11, 2019).

Follow up to #2603

In #2515, we added a function that reorders profiles to match the order in the user's profiles.json. Unfortunately, it runs in O(N^2), and it almost certainly can not. While we don't believe that the number of profiles is ever high enough that this n^2 loop is ever limiting, it could always be better.

This issue represents re-writing that method to be better.

Originally created by @zadjii-msft on GitHub (Sep 11, 2019). Follow up to #2603 In #2515, we added a function that reorders profiles to match the order in the user's `profiles.json`. Unfortunately, it runs in O(N^2), and it almost certainly can _not_. While we don't believe that the number of profiles is ever high enough that this n^2 loop is ever limiting, it could always be better. This issue represents re-writing that method to be better.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3829