Comment 1 for bug 497733

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 497733] [NEW] Paramiko startup delay makes bzr slow on Windows

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gareth White wrote:
> Public bug reported:
>
> On Windows, Paramiko has a 1.5 second delay on initialization (see bug
> 271791). What this means for Bazaar is that any commands that access a
> branch via bzr+ssh:// or sftp:// will have a 1.5 second delay.
>
> Also, having the bzr-svn plugin installed causes Paramiko to be
> initialized when using other protocols (see bug 487567). This means that
> any commands that use bzr://, http://, https:// will also have a 1.5
> second delay, even if you're not using svn at all. Note that bzr-svn is
> included by default in the Windows installer.
>
> What this means is that the majority of users on Windows are going to
> see slow performance (laggy commands) if they use nearly any kind of
> remote branch.
>
> I've tested this in Bazaar 2.0.2 and 2.1.0b3.
>

So it seems to depend on the platform. As running on Vista, I can see
that the resolution of time.time() is right at 1ms. So 1ms*100 = 100ms
startup time, and not 1.5s.

IIRC there is a global "multimedia timer resolution" switch that can be
set on Windows, which ends up affecting the resolution of time.time().

You can test it yourself by running this in a python shell:

def min_delta():
  t = time.time()
  t2 = t
  while t2 == t:
    t2 = time.time()
  return (t2 - t) * 1000.0

It gives the time resolution in milliseconds.

Anyway, one option is to apply the patch I made for PyCrypto to the
version that gets bundled with the installers.

Another option is to get paramiko to stop using RandomPool. Though it
requires a beta version of Pycrypto, (they took a *long* time to release
an updated pycrypto.)

Patching pycrypto seems like a reasonable route, and we may have been
doing it in the past, and I just forgot about it when we set up a new
build host. (I just checked, and this isn't true, though.)

Anyway, I'm fine applying a patch to the version of Crypto that we ship
with the installer if you think that will be reasonable.

 status confirmed
 importance high
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksqlKkACgkQJdeBCYSNAAMSdwCfR2gg0zmoqg5z3zwcUz27Qo26
qT0Anj8XG4tzQP8L/PvnzNrURaB6wCp2
=qP0J
-----END PGP SIGNATURE-----