Benchmarks
Performance is a core feature of Mago. Every component, from the parser to the analyzer, is designed to be as fast as possible.
We regularly benchmark Mago against other popular tools in the PHP ecosystem to ensure it remains the fastest toolchain available. The data below is fetched live from the PHP Toolchain Benchmarks dashboard (source).
Our performance promise
At its core, Mago is built on a simple philosophy: it must be the fastest.
This is not just a goal; it's a guarantee. If any tool listed in our benchmarks ever outperforms Mago in a like-for-like comparison, we consider it a high-priority bug that needs to be fixed. Speed is a feature, and we promise to always deliver it.
A note on memory usage
Mago's memory usage varies depending on the task. In some cases, like static analysis, Mago actually uses significantly less memory than alternatives (3.5x less than Psalm). In other cases, such as linting or formatting, Mago may use more memory than single-threaded PHP tools.
This is a deliberate architectural choice. Mago prioritizes your time over machine resources.
To achieve its blazing-fast speeds, Mago uses per-thread arena allocators. Instead of asking the operating system for memory for every little object (which is slow), it reserves large chunks of memory upfront and then allocates objects within that arena with near-zero cost. This enables massive parallelism but can lead to a higher peak memory footprint for some operations.
We believe that in modern development environments, saving a developer several seconds, or even minutes, is a worthwhile trade for a temporary increase in RAM usage.