Magento2 DI compilation takes too much time





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







8















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?










share|improve this question


















  • 1





    I have reported it on GitHub 3 weeks ago: #2893.

    – Mage2.PRO
    Jan 28 '16 at 12:54


















8















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?










share|improve this question


















  • 1





    I have reported it on GitHub 3 weeks ago: #2893.

    – Mage2.PRO
    Jan 28 '16 at 12:54














8












8








8


4






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?










share|improve this question














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?







magento2 compilation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 16 '16 at 5:29









amitshreeamitshree

3,272103783




3,272103783








  • 1





    I have reported it on GitHub 3 weeks ago: #2893.

    – Mage2.PRO
    Jan 28 '16 at 12:54














  • 1





    I have reported it on GitHub 3 weeks ago: #2893.

    – Mage2.PRO
    Jan 28 '16 at 12:54








1




1





I have reported it on GitHub 3 weeks ago: #2893.

– Mage2.PRO
Jan 28 '16 at 12:54





I have reported it on GitHub 3 weeks ago: #2893.

– Mage2.PRO
Jan 28 '16 at 12:54










1 Answer
1






active

oldest

votes


















9














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






share|improve this answer


























  • 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






  • 1





    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













  • The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

    – Suman-PHP4U
    2 days ago












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f97541%2fmagento2-di-compilation-takes-too-much-time%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









9














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






share|improve this answer


























  • 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






  • 1





    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













  • The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

    – Suman-PHP4U
    2 days ago
















9














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






share|improve this answer


























  • 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






  • 1





    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













  • The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

    – Suman-PHP4U
    2 days ago














9












9








9







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






share|improve this answer















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







share|improve this answer














share|improve this answer



share|improve this answer








edited 10 hours ago

























answered Jan 16 '16 at 10:41









KAndyKAndy

16.1k23245




16.1k23245













  • 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






  • 1





    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













  • The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

    – Suman-PHP4U
    2 days ago



















  • 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






  • 1





    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













  • The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

    – Suman-PHP4U
    2 days ago

















So, I should ignore this message in developer mode?

– amitshree
Jan 16 '16 at 10:55





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





Yes, You should ignor

– KAndy
Jan 16 '16 at 12:35




4




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





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




1




1





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







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















The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

– Suman-PHP4U
2 days ago





The answer looks incorrect to me. If you inject a new dependency or remove even you are in the developer mode you need to run setup:di:compile.

– Suman-PHP4U
2 days ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f97541%2fmagento2-di-compilation-takes-too-much-time%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What other Star Trek series did the main TNG cast show up in?

Berlina muro

Berlina aerponto