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

Robert Collins robertc at robertcollins.net
Tue Apr 14 00:36:03 UTC 2015


On 9 April 2015 at 00:59, Doug Hellmann <doug at doughellmann.com> wrote:

>> > Another data point on how slow our libraries/CLIs can be:
>> >
>> > $ time openstack -h
>> > <snip>
>> > real    0m2.491s
>> > user    0m2.378s
>> > sys     0m0.111s
>>
>>
>> pbr should be snappy - taking 100ms to get the version is wrong.
>
> I have always considered pbr a packaging/installation time tool, and not
> something that would be used at runtime. Why are we using pbr to get the
> version of an installed package, instead of asking pkg_resources?

Why do you make that sound like an either-or?

pbr *does* ask pkg_resources.
And if the thing isn't installed, we have to figure the version out ourselves.

We can either have that if-then-else code in one place, e.g. pbr, or
we can have it in many places, and suffer code copyitis.

The 100ms issue above is either:
 - the package isn't installed, so we're falling back to complex code
 - a bug.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the OpenStack-dev mailing list