-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
PERF: asv for import #28239
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
PERF: asv for import #28239
Changes from 7 commits
ec4d89e
47b6de7
ed992bc
015e270
72aeb48
076ab3e
b06cb1b
0629ac5
0a6e2b8
a5d9eb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Benchmarks for pandas at the package-level. | ||
""" | ||
import subprocess | ||
import sys | ||
|
||
from pandas.compat import PY37 | ||
|
||
|
||
class TimeImport: | ||
def time_import(self): | ||
if PY37: | ||
cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"] | ||
p = subprocess.run(cmd, stderr=subprocess.PIPE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a comment for this as 3.7 actually does the timing, where for < 3.7 asv is doing the timing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comment added + green |
||
|
||
line = p.stderr.splitlines()[-1] | ||
field = line.split(b"|")[-2].strip() | ||
total = int(field) # microseconds | ||
return total | ||
|
||
cmd = [sys.executable, "-c", "import pandas as pd"] | ||
p = subprocess.run(cmd, stderr=subprocess.PIPE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this a lint error to assign to p? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think it should be, no idea why it isn't. will fix anyway |
Uh oh!
There was an error while loading. Please reload this page.