Skip to content
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

importlib.test.benchmark broken #58969

Closed
pitrou opened this issue May 9, 2012 · 2 comments
Closed

importlib.test.benchmark broken #58969

pitrou opened this issue May 9, 2012 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@pitrou
Copy link
Member

pitrou commented May 9, 2012

BPO 14764
Nosy @brettcannon, @pitrou, @ericsnowcurrently

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:

assignee = 'https://github.com/brettcannon'
closed_at = <Date 2012-05-11.15:12:41.123>
created_at = <Date 2012-05-09.12:09:52.509>
labels = ['library']
title = 'importlib.test.benchmark broken'
updated_at = <Date 2012-05-11.15:12:41.122>
user = 'https://github.com/pitrou'

bugs.python.org fields:

activity = <Date 2012-05-11.15:12:41.122>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2012-05-11.15:12:41.123>
closer = 'brett.cannon'
components = ['Library (Lib)']
creation = <Date 2012-05-09.12:09:52.509>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 14764
keywords = []
message_count = 2.0
messages = ['160281', '160415']
nosy_count = 4.0
nosy_names = ['brett.cannon', 'pitrou', 'python-dev', 'eric.snow']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue14764'
versions = ['Python 3.3']

@pitrou
Copy link
Member Author

pitrou commented May 9, 2012

It seems the benchmark script didn't survive the migration:

$ ./python -m importlib.test.benchmark
Measuring imports/second over 1 second, best out of 3
Entire benchmark run should take about 33 seconds
Using <function __import__ at 0x7fdea5b3d7a0> as __import__
sys.modules [ 289195 288128 288050 ] best is 289,195
Built-in module [ 48351 48101 48432 ] best is 48,432
Source writing bytecode: small [ Traceback (most recent call last):
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 30, in bench
    total_time += timer.timeit(1)
  File "/home/antoine/cpython/opt/Lib/timeit.py", line 190, in timeit
    timing = self.inner(it, self.timer)
  File "<timeit-src>", line 6, in inner
  File "/home/antoine/cpython/opt/Lib/importlib/_bootstrap.py", line 1077, in __import__
    module = _gcd_import(name)
  File "/home/antoine/cpython/opt/Lib/importlib/_bootstrap.py", line 1024, in _gcd_import
    return _find_and_load(name, _gcd_import)
  File "/home/antoine/cpython/opt/Lib/importlib/_bootstrap.py", line 974, in _find_and_load
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '__importlib_test_benchmark__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/antoine/cpython/opt/Lib/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/antoine/cpython/opt/Lib/runpy.py", line 75, in _run_code
    exec(code, run_globals)
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 239, in <module>
    main(import_, options)
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 197, in main
    for result in benchmark(seconds=seconds, repeat=repeat):
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 108, in source_writing_bytecode
    for result in bench(name, cleanup, repeat=repeat, seconds=seconds):
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 32, in bench
    cleanup()
  File "/home/antoine/cpython/opt/Lib/importlib/test/benchmark.py", line 106, in cleanup
    sys.modules.pop(name)
KeyError: '__importlib_test_benchmark__'

@pitrou pitrou added the stdlib Python modules in the Lib dir label May 9, 2012
@python-dev
Copy link
Mannequin

python-dev mannequin commented May 11, 2012

New changeset e1d0535372d0 by Brett Cannon in branch 'default':
Issue bpo-14764: Update importlib.test.benchmark to work in a world where
http://hg.python.org/cpython/rev/e1d0535372d0

@brettcannon brettcannon self-assigned this May 11, 2012
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

2 participants