Optimized event generation.