After extensive testing, looking for workarounds, and pushing the limitations as far as possible, this is my verdict:
~99.8% of the execution time comes from the API, not Luau.
My benchmarks:
GetClasses: 2.43ms (~25%)
304-call loop: 9.9ms (~75%)
Pure Luau: 0.019ms (~0.2%)
Although I explored several alternatives through the API Dump, the minimum viable alternatives require RobloxScriptSecurity, which is not available to plugins.
I also looked into hacks and workarounds, including approaches that try to saturate CPU workload or maximize single-thread utilization, since parallelism is not possible with this API.
Recommendations
Update the PluginSetting whenever Studio updates (recommended)
The plugin would follow a workflow where, once Studio has initialized and stabilized, it runs GetClasses() in the background and compares the result against the stored PluginSetting.
If the values differ, that indicates the API has changed, and the plugin updates the stored data accordingly. This value should persist across runtime and test mode sessions.
Move it to post-initialization
If ~15ms matters during startup, I would recommend moving that work until after initialization, once FPS has stabilized. The impact on the user will be negligible, effectively just a single frame.
Use a custom pre-generated / pre-filtered API Dump
While it may become outdated after a few years, it would still include the essential APIs most Roblox developers rely on.
If keeping services up to date is a concern, I would recommend running a custom server that fetches the API Dump and performs the processing ahead of time as well. However, you should benchmark this approach and evaluate the long-term costs.
Accept the trade-off (what I would do)
This is the route I would take because I don't see 10ms as significant during initialization. If it ever became a concern, I would go with the first option.