Which is more efficient: every loop or afterwards?
The timing is important but there are much more considerations when designing a microcontroller firmware. Your question reminded me of my main concern when I started designing and commissioning microcontroller-based boards in 1995 and this concern was how to solve the EMC (electromagnetic compatibility) by firmware.
It happens that this is called defensive programming, EMC-aware programming or Immunity-aware programming.
One of the conclusions to reduce the noise effect was to collect the physical inputs at the beginning of each loop and apply the physical outputs at the end of each loop when it is possible. Inside the loop, the physical interaction with the external circuit must be reduced. But there is more to learn on this subject. A lot of techniques help you deploying your circuit in a real world.
I tried to find again the important Application notes provided by Motorola that helped me in my job at the time and I can find AN1263 but this was not the only important document on this interesting subject and there are new studies that confirm and add to these conclusions. Search for firmware defensive programming or immunity-aware programming and you will find a lot of interesting information.