Forgot to mention that those pulses of course are longer than 10 sampling periods. But you can reduce it significantly if will run each task separately in different time slots.
Timer constantly generates required slots.
Sampling ports and doing RS232 for instance are constant rate processes. Those should be sampled by every pass but finding edges can be scheduled for later. To reduce total time you also need to do finding edges in parallel for all 4 port pins. So you are just collecting information for analyzing it in later time. Average execution time is reduced anyway.