The term compilation could mislead you if you are used to programming in C or any other compiled language. The Magento compilation we will learn here only gathers PHP files together.
To enable the compilation, navigate to System | Tool | Compilation.
When the page is loaded, click on the Run Compilation Process button and wait for a while for the task to be completed. The following table shows the data with compilation enabled:
Type |
Requests |
Load time |
Size |
---|---|---|---|
Overall (before) |
49 |
2.58 seconds |
724.3 KB |
Overall (after) |
49 |
2.18 seconds |
724.3 KB |
Here we go, another half a second less in comparison with the base test.
This option will gather all PHP classes scattered all over the Magento framework into one folder. The main goal is to speed up the look-up process on the server; it is an operation done by the PHP core in order to find dependent classes and libraries scattered all over your server's filesystem. If the files are all together, the look-up operation will be easier.