Not at all. Yak shaving is getting caught up in all the surrounding, sometimes supporting tasks, so you never get to the main task.
Yak shaving is spending time finding the ultimate editor, choosing between syntax highlighters and schemes, configuring git, et c., so you never actually get around to write any code. That is different from wrenching the last nanosecond of optimisation from some not particularly central part of the code.
It's not yak shaving. Yak shaving is (possibly) recursive explosion of seemingly unrelated tasks which are required to complete the original task. The comment fits description of a maladaptive perfectionism.
Yak shaving is spending time finding the ultimate editor, choosing between syntax highlighters and schemes, configuring git, et c., so you never actually get around to write any code. That is different from wrenching the last nanosecond of optimisation from some not particularly central part of the code.