I do. I don't necessarily do it while coding, but most of the time I do, if I'm thinking about it. I had a colleague who once said his motto is: "If you don't do it right the first time, when will you?"
I find that if I don't optimize right when I'm thinking about it, either I'm forced to later out of necessity, or I never do.
This same principle applies not only to optimization, but to configuration, small value lookups, etc.. Do I throw configuration into a file? In a config table in the database? Do I make my very small set of values of this thing a hard-coded set? An enum? A lookup table in the database? If I put these things in a database, do I make a front end for it to manage it, or just deal with direct DB management? Stuff like this. All are decision points that affect how much time one spends on a project.
Of course, sometimes, there's projects that just have to be done quickly. In that case, optimization and other decisions that would extend the implementation time go out the window in favor of getting the project complete. Then later, I make sure to go back and take care of those other things to make my left easier down the road. I view it as implementation and post-implementation duties. I try to have very few post-implementation duties as there's always another project looming on the horizon, limiting my time for such things.