Shortcode perfomance solution

I’d say make the button–but not for performance reasons.

I think if you benchmark it, you’ll find that any performance overhead added by running a simple function like this (one that does some simple string concat) is quite minimal. Or, at least, down to fractions of fractions of a second on a decent server.

If you’re under very high load, and are worried about performance at this level, you should probably focus on a good caching layer and a fast server. We (and by we I mean our awesome sysadmin guy) have recently been playing with an nginx / varnish setup, and it’s boosted performance to an unbelievable degree. (See this guy, who got it to work very well)

Of course, it’s not a silver bullet, and you should always have an eye toward reducing the number of queries run, requests made, etc. So I get your intent. The kind of functionality you’re attempting with this question is admirable (a TinyMCE button is a MUCH better user experience than a shortcode), but I don’t think it’ll help much when it comes to performance.

Leave a Comment