-
Notifications
You must be signed in to change notification settings - Fork 590
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
add bench with join type and cache workload #19789
Draft
kwannoel
wants to merge
9
commits into
main
Choose a base branch
from
12-13-add_bench_with_join_type_and_cache_workload
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+214
−86
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
97e2789
add bench with join type and cache workload
kwannoel c7a6602
loosen constrains
kwannoel ea40461
fix
kwannoel bbc17db
use 64 chunk_size
kwannoel 12c91cf
control chunk size based on workload
kwannoel 7f6534e
use pb join type instead to get name instead of number
kwannoel aab72b4
fix format string
kwannoel e943207
add program to monitor mem use
kwannoel e7ac4ac
update script to add rt
kwannoel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
# Executes full benchmark for stream_hash_join runtime and memory consumption | ||
# Outputs a json file with the results. | ||
|
||
import subprocess | ||
import re | ||
import sys | ||
|
||
# Print header | ||
results = ["Amp,Workload,JoinType,Total Blocks,Total Bytes,Runtime (ns)"] | ||
|
||
# Run benchmarks and capture results | ||
for amp in [20_000, 40_000, 200_000, 400_000]: | ||
for workload in ["NotInCache", "InCache"]: | ||
for join_type in ["Inner", "LeftOuter"]: | ||
# Construct the command | ||
cmd_mem = f'ARGS={amp},{workload},{join_type} cargo bench --features dhat-heap --bench stream_hash_join_mem' | ||
cmd_rt = f'cargo criterion --message-format json --bench stream_hash_join_rt -- hash_join_rt_{amp}_{workload}_{join_type}' | ||
|
||
s = "" | ||
|
||
try: | ||
# Run cmd_mem and capture output | ||
output = subprocess.check_output(cmd_mem, shell=True, stderr=subprocess.STDOUT, universal_newlines=True) | ||
|
||
# Extract total blocks and bytes | ||
total_blocks_match = re.search(r'max_blocks:\s*(\d+)', output) | ||
total_bytes_match = re.search(r'max_bytes:\s*(\d+)', output) | ||
|
||
if total_blocks_match and total_bytes_match: | ||
total_blocks = total_blocks_match.group(1) | ||
total_bytes = total_bytes_match.group(1) | ||
|
||
s+=f"{amp},{workload},{join_type},{total_blocks},{total_bytes}" | ||
else: | ||
print(f"No total_blocks or total_bytes found for: Amp={amp}, Workload={workload}, JoinType={join_type}", file=sys.stderr) | ||
|
||
# Run cmd_rt and capture output | ||
json_output = subprocess.check_output(cmd_rt, shell=True, universal_newlines=True) | ||
json_output = json_output.split('\n') | ||
try: | ||
time_ns = json.loads(json_output[0])["typical"]["estimate"] | ||
except Exception as e: | ||
print(f"could not parse {json_output[0]} due to {e}") | ||
exit(1) | ||
if time_ns: | ||
s+=f",{time_ns}" | ||
else: | ||
print(f"No runtime found for: Amp={amp}, Workload={workload}, JoinType={join_type}", file=sys.stderr) | ||
|
||
results.append(s) | ||
|
||
except subprocess.CalledProcessError as e: | ||
print(f"Error running benchmark for Amp={amp}, Workload={workload}, JoinType={join_type}", file=sys.stderr) | ||
print(f"Error output: {e.output}", file=sys.stderr) | ||
|
||
for result in results: | ||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.