I am by no means good at redstone, so I do not know if my solution is compact or efficient (or any good at all!).
My approach is to make the pistons fire alternatively constantly until the string is not triggered for a few seconds then it stops firing the pistons. This way there is always a constant piston firing rate and after the last item has fallen through the string the pistons still fire a couple of times just in case some items fell on top of a slime block then this will clear the items.
In the images you can see I made a pulse extender coming off the observer that is looking at the string. Then there are observers looking at the dust that is part of the pulse extender and every time the pulse degrades the observers trigger. Then after those observers are repeaters to slightly extend the pulse so that the pistons fire slow enough not to leave their slime blocks behind.
Note that the repeater after the left observer is 3 ticks and the repeater after the right observer is 4 ticks.