Don't make unnecessary calls to LazyFqdn.__str__. #376

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@lndbrg
Contributor
lndbrg commented Aug 15, 2014

Before this patch we always tried to expand variables in the
config even if they weren't present. This meant that we made an
expensive call to LazyFqdn.str the first iteration of the expand
loop, stealing precious cpu and user time.

We now check that the expansion actually exists in the config
before expanding it, this will speed up the case where %l is not
used.

This fixes #338

@lndbrg lndbrg Don't make unnecessary calls to LazyFqdn.__str__.
Before this patch we always tried to expand variables in the
config even if they weren't present. This meant that we made an
expensive call to LazyFqdn.__str__ the first iteration of the expand
loop, stealing precious cpu and user time.

We now check that the expansion actually exists in the config
before expanding it, this will speed up the case where %l is not
used.

This fixes #338
29e0963
@coveralls

Coverage Status

Coverage decreased (-0.2%) when pulling 29e0963 on lndbrg:dont-stringify-fqdn-if-its-not-in-the-config into 991d56b on paramiko:master.

@bitprophet bitprophet added this to the 1.12.5 et al milestone Aug 19, 2014
@bitprophet bitprophet added a commit that referenced this pull request Aug 26, 2014
@bitprophet bitprophet Changelog re #376, closes #376 3908baa
@bitprophet bitprophet added a commit that closed this pull request Aug 26, 2014
@bitprophet bitprophet Changelog re #376, closes #376 3908baa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment