Add the basic benchmarks

This commit is contained in:
Anthony Shaw
2022-02-22 10:53:05 +11:00
commit bc04385656
5 changed files with 247 additions and 0 deletions

14
bench_imports.py Normal file
View 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"),
]