[openstack-dev] [all][oslo][clients] Let's speed up start of OpenStack libs and clients by optimizing imports with profimp

Boris Pavlovic boris at pavlovic.me
Sun Apr 5 22:41:18 UTC 2015


Brant,

I run profimp with and without patch
https://review.openstack.org/#/c/164066/:
And it really works well:

before 170ms:
http://boris-42.github.io/keystone/before.html

after 76ms:
http://boris-42.github.io/keystone/after.html


Best regards,
Boris Pavlovic


On Fri, Apr 3, 2015 at 2:44 AM, Monty Taylor <mordred at inaugust.com> wrote:

> On 04/02/2015 06:22 PM, Brant Knudson wrote:
> > 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.
>
> Yes please.
>
> Also - for libraries - let's try to not import lots of things.
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150406/07b1ca87/attachment.html>


More information about the OpenStack-dev mailing list