Hi,
The book is exactly right.
A function should be a simple as possible. That should be a habit. Maybe for a very simple webpage you won't notice any difference, but as you go on to develop more and more complex systems you will find that by making functions simple you will avoid a heap of unnecessary bugs.
It's much easier to find issues with separate functions that each perform a single, easily measurable task. And as a bonus, you will find it much easier to reuse portions of your code and prevent duplication. Each piece of functionality should only be coded once, otherwise when you need to change how something is calculated, for example, you have to hunt through your code to find all the places that need to be changed.
And the rendering time (or rather the download time) difference is insignificant compared to the added maintainability of your code.