-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update benchmarks to handle pip dependencies for user #10070
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
Changes from all commits
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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| data | ||
| results | ||
| results | ||
| .venv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -440,6 +440,9 @@ compare_benchmarks() { | |
| fi | ||
|
|
||
| echo "Comparing ${BRANCH1} and ${BRANCH2}" | ||
| python3 -m venv ./${SCRIPT_DIR}/venv | ||
|
Contributor
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 automatically creating / removing a virtual env each run may be surprising to people already managing their enviornment What would you think about adding a new command that worked like That might work like # creates virtual environment in $SCRIPT_DIR/venv (alongside data)
# prints out a message about how to activate it
$ bench.sh venv
$ source venv/bin/activate.sh # do what bench.sh tells you
...
$ bench.sh run tpch
Contributor
Author
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 do like that idea a bit more than what I have implemented now. I would be open to taking that route and updating the PR. Thanks for the feedback, its much appreciated! |
||
| source ./${SCRIPT_DIR}/venv/bin/activate | ||
| pip3 install rich | ||
| for bench in `ls ${BASE_RESULTS_DIR}/${BRANCH1}` ; do | ||
| RESULTS_FILE1="${BASE_RESULTS_DIR}/${BRANCH1}/${bench}" | ||
| RESULTS_FILE2="${BASE_RESULTS_DIR}/${BRANCH2}/${bench}" | ||
|
|
@@ -448,11 +451,12 @@ compare_benchmarks() { | |
| echo "Benchmark ${bench}" | ||
| echo "--------------------" | ||
| python3 "${SCRIPT_DIR}"/compare.py "${RESULTS_FILE1}" "${RESULTS_FILE2}" | ||
|
|
||
| else | ||
| echo "Note: Skipping ${RESULTS_FILE1} as ${RESULTS_FILE2} does not exist" | ||
| fi | ||
| done | ||
|
|
||
| rm -r ./${SCRIPT_DIR}/venv | ||
| } | ||
|
|
||
| # And start the process up | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,14 +24,8 @@ | |
| from typing import Dict, List, Any | ||
| from pathlib import Path | ||
| from argparse import ArgumentParser | ||
|
|
||
| try: | ||
|
Contributor
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 this is still a helpful error message
Contributor
Author
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. Thats a good point and I can roll this back. Since rich isn't STL its probably a good idea to keep this. |
||
| from rich.console import Console | ||
| from rich.table import Table | ||
| except ImportError: | ||
| print("Try `pip install rich` for using this script.") | ||
| raise | ||
|
|
||
| from rich.console import Console | ||
| from rich.table import Table | ||
|
|
||
| @dataclass | ||
| class QueryResult: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the script makes a
venvdirectory, not a.venvdirectory, should this bevenv?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I changed it last second, but will update!