Process events optimized loop.