New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importing of "time" module is terribly slow #51242
Comments
The behaviour described below is not always reproduced. The attached test script simply tries to import a couple of dns-python Attached are stdout log and system call log produced by strace with I don't know what causes it but I'm getting it on at least two machines $ cat /etc/fedora-release
Fedora release 10 (Cambridge)
$ uname -a
Linux kiki 2.6.27.30-170.2.82.fc10.i686.PAE #1 SMP Mon Aug 17 08:24:23
EDT 2009 i686 i686 i386 GNU/Linux
$ python -c "import sys; print sys.version"
2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
[GCC 4.3.2 20080917 (Red Hat 4.3.2-4)]
$ cat /etc/redhat-release
CentOS release 5.3 (Final)
$ uname -a
Linux proxy.sc.com 2.6.18-128.el5 #1 SMP Wed Jan 21 10:44:23 EST 2009
i686 i686 i386 GNU/Linux
$ python -c "import sys; print sys.version"
2.4.3 (#1, Jan 21 2009, 01:10:13)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] I don't think it's related to dns-python(that's why I am posting it The timestamps in stdout.log and strace.log clearly show the slowdown: # strace.log # stdout.log |
Hmm, in dns.entropy module (I found the code there: The time module is innocent here. |
Stupid me :)) Still I don't understand why the read call takes 10 seconds to complete. |
OK, I found the reason and it is the very fact of using /dev/random The mystery is revealed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: