Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slow page load (cache creation problem?) #685

Open
thom777 opened this issue Oct 30, 2013 · 6 comments
Open

slow page load (cache creation problem?) #685

thom777 opened this issue Oct 30, 2013 · 6 comments

Comments

@thom777
Copy link

thom777 commented Oct 30, 2013

Our "AdmingeneratorGeneratorBundle" backend applications responses rather slow. The problem seems to be in the which loads for over a second. Not only on cache generation, but on every call (dev & prod):

bildschirmfoto 2013-10-30 um 17 36 37

I discovered a possible relation to the "mustOverwriteIfExists" property in TwigGenerator/Builder/BaseBuilder.php. If this property is testwise set on false, it's fast as desired after a reload. If I leave it on true, there are only a dozen recreated files, but this takes over a second. Any help is appreciated.

@cedriclombardot
Copy link
Member

Ok so it means in
https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle/blob/master/Generator/Generator.php#L87..L119
this
function return true. Can be due to a forced config or a bad detection of
date modification of yml else of a bad cache generation (an
EmptyBuilderClass keeped in cache )

First of all try clear cache and re warmup else try doing var dump in this
method to know why it's return true

2013/10/30 thom777 [email protected]

Our "AdmingeneratorGeneratorBundle" backend applications responses rather
slow. The problem seems to be in the which loads for over a second. Not
only on cache generation, but on every call (dev & prod):

[image: bildschirmfoto 2013-10-30 um 17 36 37]https://f.cloud.github.com/assets/364398/1438778/88a14b6a-4181-11e3-9234-f104802e56fd.png

I discovered a possible relation to the "mustOverwriteIfExists" property
in TwigGenerator/Builder/BaseBuilder.php. If this property is testwise set
on false, it's fast as desired after a reload. If I leave it on true, there
are only a dozen recreated files, but this takes over a second. Any help is
appreciated.


Reply to this email directly or view it on GitHubhttps://github.com//issues/685
.

@thom777
Copy link
Author

thom777 commented Oct 30, 2013

Yes, exactly, in this function "if (false !== strpos(file_get_contents($file), 'AdmingeneratorEmptyBuilderClass')) {" returns true. There are arround 10 files which contain "AdmingeneratorEmptyBuilderClass" and are therefore regenerated. I'm just wondering why the "simple" regeneration of these files takes a full second.

@cedriclombardot
Copy link
Member

The real problem for me its the fact that they stay in this state a yaml
config problem like error in namespace config ?
Le 30 oct. 2013 18:21, "thom777" [email protected] a écrit :

Yes, exactly, in this function "if (false !==
strpos(file_get_contents($file), 'AdmingeneratorEmptyBuilderClass')) {"
returns true. There are arround 10 files which contain
"AdmingeneratorEmptyBuilderClass" and are therefore regenerated. I'm just
wondering why the "simple" regeneration of these files takes a full second.


Reply to this email directly or view it on GitHubhttps://github.com//issues/685#issuecomment-27415045
.

@thom777
Copy link
Author

thom777 commented Oct 31, 2013

Thanks for your hint Cedric. I was able to track down the problem. There was a "left over" controller folder in the directory tree with no generator.yml file related. The same problem also appears, if there is for example a NewController, but no related "new" section in the generator.yml file. This was the reason for the generated "AdmingeneratorEmptyBuilderClass" files. After having deleted this controller folder, the speed is back on a normal level again. cheers!

@thom777 thom777 closed this as completed Oct 31, 2013
@ioleo
Copy link
Member

ioleo commented Nov 4, 2013

@cedriclombardot To me this seems like a serious performance issue. If there is no related new section in the generator.yml then Admingenerator should skip / ignore all related files (e.g. NewController).

Or there should be some command like admin:admin-cleanup which removes all files without related generator.yml files (or sections).

@ioleo ioleo reopened this Nov 4, 2013
@thom777
Copy link
Author

thom777 commented Nov 5, 2013

Sounds like a good idea to me, as all of the controllers are generated by default. So if you don't use and therefore delete one of the generator.yml sections (which quite often happens), you directly run into this issue. I think the "normal" user isn't aware of the fact, that in this case he should also delete the related autogenerated controller. This might cause performance losses to a lot of people at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants