Forums › Forums › OroCRM › OroCRM – Programming Questions › How to speed up the debug speed?
This topic contains 8 replies, has 5 voices, and was last updated by asolonenko 7 years, 4 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- April 12, 2016 at 9:52 pm #25151
Hi,
I am developing a AppBundle for orocrm and I use app_dev.php/xxx to test my function.
The page response time is very very slow when I change the controller or template or entity..If I use app.php, I need to clean cache by php app/console cache:clear and the action is also very very slow.
Any suggestion?
Thank you.David
- CreatorTopic
- AuthorReplies
- April 20, 2016 at 2:48 am #25152
In my experience, Oro uses quite a lot of resources, so can be a little slow when developing locally. If you use a virtual machine for development, try increasing the amount of resources (memory, CPU) the machine has available.
Also ensure you’re running as few programs on your host machine as possible and stop any applications that appear to be using more resources than others. I found Spotify was being quite a CPU hog and made it very difficult to use Oro. Closing that really made a difference. Back to CDs then!
August 1, 2016 at 3:20 am #25153Hi,
thanks for your appeal. We’ve investigated this issue and found how to fix it for controllers. The main issue was that container fully rebuilds after changes in these files. Now if you make changes in controller it will have impact only on acl annotation cache.
All the mentioned changes will be included into upcoming release.
October 7, 2016 at 11:56 am #25154Hi Asolonenko,
Would you mind to point the corresponding commit or impacted class of this cache rebuilding enhancement please ?
My team and I, are stuck on an old version (1.8.2) of OroCRM and can’t upgrade it at this moment.
It’ll be a big improvment for us, regarding the time we spent when we work on Config and Controller files.Thanks in advance for your feedback.
Best regards,
Lucas.
October 18, 2016 at 5:56 am #25155Can someone help me on this subject ?
We haven’t found a way to reduce the cache rebuilding process when working on config/controller files.Thanks in advance,
Lucas
October 18, 2016 at 7:33 am #25156Hi! Sorry for waiting.
Please look at the
https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/SecurityBundle/Annotation/AclListener.php
https://github.com/orocrm/platform/blob/master/src/Oro/Component/Config/Dumper/CumulativeConfigMetadataDumper.phpHere we use separate Metadata dumper for acl annotations that earlier affects on container build. We move them to cache and now if you edit controller it will rebuild only annotations cache but not container.
Feel free if you have any questions about it.
October 19, 2016 at 12:22 am #25157Many thanks for your help.
We gonna investigate how to correctly set it up.
I’ll let you know if we encounter some difficulties on this.Lucas.
November 30, 2016 at 5:55 am #25158Hi Asolonenko,
I’m working in the Hecalu’s team , and i’m trying to reduce the cache rebuild process time regarding to your answer.
After making the changes that you have recommended, the rebuild cache process take the same time to rebuild.
Furthermore, i had to add services :For AclListener class Oro\Bundle\SecurityBundle\Annotation\AclListener :
YAML1234567oro_security.acl.annotation_listener:class: Oro\Bundle\SecurityBundle\Annotation\AclListenerarguments:- '@oro_security.acl.annotation_provider'- '@oro_security.acl.annotation.metadata.dumper'tags:- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }For MetadataDumper Oro\Component\Config\Dumper\CumulativeConfigMetadataDumper :
YAML1234567oro_security.acl.annotation.metadata.dumper:class: Oro\Component\Config\Dumper\CumulativeConfigMetadataDumperpublic: falsearguments:- %kernel.cache_dir%- %kernel.debug%- 'oro_acl_annotation'Also, i had to declare an other service called during the preFLush event trigger :
YAML123456oro_security.entity_security_config_listener:class: Oro\Bundle\SecurityBundle\EventListener\EntitySecurityMetadataConfigListenerarguments:- '@oro_security.entity_security_metadata_provider'tags:- { name: kernel.event_listener, event: oro.entity_config.pre_flush, method: preFlush }Regarding that, i added die() function in each function of the three classes : the system stop well, so the class are well loaded.
Could you please let me know if there any other modifications to do, in order to make it work ?Thanks in advance,
Thomas
November 30, 2016 at 7:59 am #25159Hi!
Be sure that you don’t add provider for metadata to container in DependencyInjection file and check that cache created in proper cache directory. In my case it’s in cache/dev/oro_data/oro_acl_annotations and I have special meta file with resources cache/dev/oro/Oro_config_meta/oro_acl_annotation.meta. In your case name of file could be another.
- AuthorReplies
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.