Skip to content

Conversation

@Kami
Copy link
Member

@Kami Kami commented Mar 20, 2021

I was looking at st2api profiling data some more and noticed we spend more time in stevedore code then we should.

It turns on that we were not loading all the extensions just once, but X + 1 times where X is number of runners (stevedore extensions).

This is obviously not the fastest thing since loading extensions requires pkg resources scan for available extensions.

This pull request fixes that. It should now also result in much less DEBUG level noise on service start up time.

…ad of

creating new DriverManager instance per extension.

Creating new instance is not needed and results in disk / pkg resources
scan per runner (extension) which is slow.

This also substantially reduces debug log noise on service start up.
@pull-request-size pull-request-size bot added the size/S PR that changes 10-29 lines. Very easy to review. label Mar 20, 2021
@amanda11 amanda11 added this to the 3.5.0 milestone Mar 21, 2021
Copy link
Contributor

@amanda11 amanda11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a minor typo


for name in extension_names:
# NOTE: We use ExtensionManager directly instead of DriverManager per extension since that is
# much faster and allows us to reduce stevedore loading overead for each runner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - overhead not overead

@Kami Kami merged commit b05e1ae into master Mar 21, 2021
@Kami Kami deleted the speed_up_runner_registration branch March 21, 2021 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance size/S PR that changes 10-29 lines. Very easy to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants