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

Doug Hellmann doug at doughellmann.com
Mon Apr 6 14:19:41 UTC 2015


Excerpts from Brant Knudson's message of 2015-04-06 09:02:55 -0500:
> On Sun, Apr 5, 2015 at 5:41 PM, Boris Pavlovic <boris at pavlovic.me> wrote:
> 
> > 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
> >
> >
> >
> Looks like now the issue is that keystoneclient imports pbr.version so that
> it can get pbr to generate the __version__ value. Maybe pbr could be more
> efficient about the work it does on import, or we could figure out a
> different / lazy way to generate the version string.
> http://git.openstack.org/cgit/openstack/python-keystoneclient/tree/keystoneclient/__init__.py#n35
> 
> How far do we need to go with this?

We can use pkg_resources to ask for the version of anything installed.
What's the benefit of having a dynamically generated version string
embedded in a module?

Doug



More information about the OpenStack-dev mailing list