Well, the short answer is the first item consumes more memory then the second one. One of the reason would be that WordPress hooks uses call_user_func_array()
to call al those functions dynamically. And call_user_func_array()
actually takes an array as one of its parameter and do a search for a function with this name. So in run time it causes memory and time. You can check the menory and time difference using e.g. memory_get_usage()
and timer_stop()
. Many good plugins out there to help with that.
But already many other core WordPress functions and other plugins hooking themselves and their functions to that hook. So your three functions will be just three new element in that array and I think it’s not gonna be performance issue. And if you think you wanna reduce the consumed time and memory caused by your three function, keep in mind that it is too little to ignore based on code maitainability. The first way of your’s is pretty readable as well as maitainable. So I think you can ignore the performance issue unless it really grows into something which should not be ignored (Which is not gonna happen 🙂 ).