[openstack-dev] [all][oslo][clients] Let's speed up start of OpenStack libs and clients by optimizing imports with profimp
Brant Knudson
blk at acm.org
Thu Apr 2 22:22:19 UTC 2015
On Thu, Apr 2, 2015 at 4:52 PM, Boris Pavlovic <boris at pavlovic.me> wrote:
> Hi stackers,
>
> Recently, I started working on speeding up Rally cli.
>
> What I understand immediately is that I don't understand why it takes
> 700-800ms
> to just run "rally version" command and it is impossible hard task to find
> what takes so much time just by reading the code.
>
> I started playing with patching __import__ and make a simple but powerful
> tool
> that allows you to trace any imports and get pretty graphs of nested
> importing with timings:
>
> https://github.com/boris-42/profimp
>
> So now it's simple to understand what imports take most of time, just by
> running:
>
> profimp "import <lib>" --html
>
>
> Let's optimize OpenStack libs and clients?
>
>
> Best regards,
> Boris Pavlovic
>
>
There's a review in python-keystoneclient to do lazy importing of modules
here: https://review.openstack.org/#/c/164066/ . It would be interesting to
know if this improves the initial import time significantly. Also, this can
be an example of how to improve other libraries.
- Brant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150402/78e40782/attachment.html>
More information about the OpenStack-dev
mailing list