Skip to content

Delay from_list tuple create in import #1330

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

Merged
merged 1 commit into from
Aug 31, 2019

Conversation

palaviv
Copy link
Contributor

@palaviv palaviv commented Aug 31, 2019

This change decreases the time when importing a module which is already in sys.modules. If you will run the following script:

import time
start = time.time()
import io
mid = time.time()
import io
end = time.time()
print(mid - start)
print(end - mid)

Before the change you will get:

0.0029745101928710938
0.00000667572021484375

After the change:

0.002993345260620117
0.000006198883056640625

@windelbouwman windelbouwman merged commit 332c157 into RustPython:master Aug 31, 2019
@windelbouwman
Copy link
Contributor

This looks good to me, tiny speed enhancement, but also a code simplification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants