The object class is imported only once, whereas I agree the driver's object is instantiated every time. I suspect it's going to be a bit of work to restructure the code to accommodate a single instance of the driver; I am not opposed to the idea but I wonder if we can do some preliminary profiling to establish whether this refactoring is really worth it. If we managed to shave like 10-20% of execution times during this ops then great but I suspect that numbers are not going to look that great.
** Changed in: neutron Status: Confirmed => Opinion -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1318528 Title: DHCP agent creates new instance of driver for each action Status in OpenStack Neutron (virtual network service): Opinion Bug description: Working on rootwrap daemon [0] I've found out that DCHP agent asks for root_helper too often. [1] shows traceback for each place where get_root_helper is being called. It appeared that in [2] DHCP agent creates an instance of driver class for every single action it needs to run. That involves both lots of initialization code and very expensive dynamic import_object routine being run. [2] shows that the only thing that changes between driver instances is a network. I suggest we make network an argument for every action instead to avoid expensive dynamic driver instantiation. Links: [0] https://review.openstack.org/84667 [1] http://logs.openstack.org/67/84667/20/check/check-tempest-dsvm-neutron/3a7768e/logs/screen-q-dhcp.txt.gz?level=INFO [2] https://github.com/openstack/neutron/blob/master/neutron/agent/dhcp_agent.py#L122 To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1318528/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp