Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
data
results
results
.venv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the script makes a venv directory, not a .venv directory, should this be venv?

Copy link
Contributor Author

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!

6 changes: 5 additions & 1 deletion benchmarks/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ compare_benchmarks() {
fi

echo "Comparing ${BRANCH1} and ${BRANCH2}"
python3 -m venv ./${SCRIPT_DIR}/venv
Copy link
Contributor

Choose a reason for hiding this comment

The 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 bench.sh data like bench.sh venv

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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}"
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions benchmarks/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@
from typing import Dict, List, Any
from pathlib import Path
from argparse import ArgumentParser

try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still a helpful error message

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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:
Expand Down