Ever since LR 7.3 introduced the new develop preset format, it takes O(n^2) time for a plugin to access all of the develop presets. Some users have 5K, 10K, or 15K presets, and it can take minutes for a plugin to access all of the presets:
for _, folder in ipairs (LrApplication.developPresetFolders ()) do
for _, preset in ipairs (folder:getDevelopPresets ()) do
...
Users think the plugin has crashed or hung! While having 10K presets may seem unusual, there's no excuse for LR to take minutes to return all the presets.
Here's how fast my LR / Mac OS loads presets versus the total number of presets:
Most likely, LR is storing all the presets in all the folders in a single flat list. When the method folder:getDevelopPresets() is called, it scans the entire list for presets with a matching group. The correct implementation is obvious: Use a hierarchical representation, with a list of folders, each folder with a list of presets.