Every change you make to what you are focused on costs mental energy. A day spent switching back and forth from one context to another will absolutely drain your productivity compared to what you can achieve when focused deeply on just one thing at a time. Every time you switch tasks, you bring along a residual drain from everything you’ve focused on before, which will continue to reduce your available output for subsequent tasks. The only way to thoroughly purge these attention residues seems to be through a good night’s sleep. The overhead from prior tasks that increases throughout the day is yet another reason to prioritize each day’s tasks by highest priority.
Context switches can also assist you. When your momentum is dipping below threshold, you can leverage an intentional context switch to make faster progress on another task. Though switching to another task obviously stalls your progress on the first, wise use of intentional context switching will yield much higher productivity than dogmatically insisting on executing only one task until it is complete.