It's not that smart for these cases. No AI required. Run the app with various cogs, benchmark each run, pick the cog than ran fastest. Compiling for cog picks will take more time. The programmer would be responsible for sending the right dummy data by linking to a data gen cog and writing tests.
Cogs come with lots of metadata for use cases, performance profiles, data sizes, etc. They don't need to be marketed, tried by hundreds of hopeful devs and become resume buzzwords. The programmer no longer needs to read HN and care about the shiniest new cogs. Mental overhead is greatly reduced.