Add the basic benchmarks
This commit is contained in:
14
bench_imports.py
Normal file
14
bench_imports.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from os.path import exists
|
||||
import os
|
||||
|
||||
def dotted_import():
|
||||
for _ in range(100_000):
|
||||
return os.path.exists('/')
|
||||
|
||||
def direct_import():
|
||||
for _ in range(100_000):
|
||||
return exists('/')
|
||||
|
||||
__benchmarks__ = [
|
||||
(dotted_import, direct_import, "Importing specific name instead of namespace"),
|
||||
]
|
||||
Reference in New Issue
Block a user