In general, it is best to start thinking about optimization at the beginning of the design process, so that you can build your site to support your desired outcome.
By taking the time to optimize your website from the start, you can save yourself a lot of time and double effort.