re: echoing / performance
To increase performance, you can enable output buffering.
It is preferable to use echo instead of concatenating strings, which increase server load (hence decreasing performance).
However, it is good practice to encapsulate functions/methods in modules. Tips in favour of modularity and maintainability, over performance.