After creating/updating new module/theme, I use following command in root Magento installation directory

php bin/magento setup:upgrade

Which asks me to run compilation, so I use

 php bin/magento setup:di:compile

which takes around 8 minutes of time to compile it. Is there a way to fasten the compilation process?

  • 1
    I have reported it on GitHub 3 weeks ago: #2893. – Mage2.PRO Jan 28 '16 at 12:54

First of all, compilation need only in production mode. If you develop, you do not need to run compilation

It's hard to improve compilation, because in this process build tree of all classes in system. For example change in 'di.xml' can affect half of classes.

In developer mode, if you modify/create constructor you still need to delete generated/code/ folder to remove auto generated code and cleanup cache

  • So, I should ignore this message in developer mode? – amitshree Jan 16 '16 at 10:55
  • Yes, You should ignor – KAndy Jan 16 '16 at 12:35
  • 4
    Also, as soon you ran compilation once, there will be *.ser files in /var/di and you should delete them, otherwise they are still used. – Fabian Schmengler Mar 6 '16 at 12:52
  • 2
    even in developer mode, if create constructor or modify any of them, you still need to run setup:di:compile. maybe this is now required in latest magento version. – Doni Wibowo Oct 3 '17 at 13:57
  • 1
    DoniWibowo @Suman-PHP4U I updated the response about the code changes – KAndy Apr 12 '19 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.