Optimizing function that automatically creates internal links based on post title string

  1. Use a cache plugin (or write your own custom cache plugin) to server those posts.
  2. Set the cache plugin to update posts’ contents whenever any other post title is updated / added. Or you can do this in a background process using cron.

This way your original content remains intact, but you still get quick response from the server.