Smarter temp/cache rebuilding on dev machine?

dkorpar
Member | 135
+
0
-

Currently whenever you change any file whole temp/cache is rebuilded on dev machine.
I have a big project which uses Kdyby/AOP so it takes really long time to rebuild everything and that costs us to much.
When I remove aop extension then it's much faster, but I need it and don't want to remove it. Is there some way that I can define when will what be rebuilded? I would be much happier if I could somehow exclude aop from this completelly, (editing code inside kdyby/aop is not an issue since Kdyby is not maintain this anymore at all and I'm using my fork which works with newest versions of nette)
Any way to do some more specific configs on that or some more control?
I would much rather that this gets rebuilded only like on production, when you delete temp/cache directory…
Any way to at least set this so nothing is rebuilded if I don't delete temp/cache dir?
could be little bit annoying because of latte files, but otherwise I wouldn't have to wait more then 40+ seconds for DIC to rebuild for every time I do any change and want to see result in browser

Last edited by dkorpar (2018-01-09 16:14)

CZechBoY
Member | 3608
+
0
-

And what is rebuild exactly? For example if you change latte files, only related latte files are generated. If you change some php file then Nette Configurator is rebuild (that is Nette 2.3 behavior, Nette 2.4 is much better in necessary rebuild).

dkorpar
Member | 135
+
0
-

We're using nette 2.4, allways on latest version…
If I change .php file I see that response time takes 40+ seconds, while any other requests are around 500ms-1s on dev machine. If I look at tracy bar it looks something like this: http://prntscr.com/hy4x0l
With little bit playing around I've noticed that AOP extension is taking really long time in this process.
I was looking already into AopExtension.php and I could do some hacks so it's not rebuilded every time, but it's really hacky approach which I never like to use and nette is basically forcing this. AOP extension have to go through all services parse annotations and create proxy classes in file. With our amount of services it can take some time. With all this in mind it is much better for us to delete temp/cache when that's really needed rather then having container recreate and taking 40+ seconds on every request.

We're using AOP only for functions with annotations
methodAnnotatedWith(Some\Annotation)

When using nette as someone who's not from Czech it's really hard to fine some more advanced documentation, or any other articles.

Last edited by dkorpar (2018-01-09 18:41)

dkorpar
Member | 135
+
0
-

it's fixed partially by introducing marker interfaces with aop, but still not as fast as we would like. now it's taking 5–6 seconds for DIC to be recreated…
I couldn't find anywhere how to force nette not to recreate container on change of any file, can someone point me to correct direction?

nightfish
Member | 517
+
+2
-

dkorpar wrote:

I couldn't find anywhere how to force nette not to recreate container on change of any file, can someone point me to correct direction?

Have a look at the second parameter of the constructor of Nette\DI\ContainerLoader – it is being called from Nette\Configurator

Last edited by nightfish (2018-01-09 22:26)