Magento's controlleractiondispatch events run globally and can slow your site. Use plugins or targeted observers instead, unless you need to log or call an API after every request. Offload heavy work to a queue like RabbitMQ.
Chapters
Before and after every controller action executes. Magento also fires off a pre and post dispatch event, but should you ever use it, these dispatch events execute globally, regardless of the context. This can introduce a crazy amount of overhead when running any complex logic. They also lack metadata linked to a specific event, which is where plugins and event observers really shine. But there could be scenarios where this could be incredibly useful. For example, if you needed to write something to a log file or call an external API after every request, you just need to be mindful about how this code executes. PHP is synchronous, so any code executed within one of these events can very easily slow down your entire store. If you do use a controller action dispatch event, consider writing the related code to a worker queue such as rabbitmq. This allows these tasks to be processed in the background, which is a scalable solution and won't slow down your entire store.