-
Notifications
You must be signed in to change notification settings - Fork 0
perf: Zero-copy binary refactor and CLOCK replacer #17
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4db1cba
perf: implement CLOCK algorithm and infrastructure for zero-copy opti…
poyrazK 472e9fb
perf: complete zero-copy binary refactor and fix drop file path
poyrazK 0563338
style: automated clang-format fixes
poyrazK dc8d630
ci: add automated performance benchmarking job
poyrazK bf3a901
perf: optimize storage engine with zero-copy binary format and optimi…
poyrazK a5b2e82
style: automated clang-format fixes
poyrazK fc05031
ci: implement performance regression check with failure threshold
poyrazK 94e9577
fix: address review findings for type safety, encapsulation, and reso…
poyrazK b14774c
style: automated clang-format fixes
poyrazK 9ff15da
ci: make performance regression script more robust with shebang and e…
poyrazK 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,72 @@ | ||
| #!/usr/bin/env python3 | ||
| import json | ||
| import sys | ||
| import os | ||
|
|
||
| def check_regression(current_file, baseline_file, threshold=0.2): | ||
| # Load current results - failure here is a fatal error | ||
| try: | ||
| with open(current_file) as f: | ||
| current = json.load(f) | ||
| except Exception as e: | ||
| print(f"Error loading current performance results from {current_file}: {e}") | ||
| return False | ||
|
|
||
| # Load baseline results - missing file is handled gracefully | ||
| try: | ||
| with open(baseline_file) as f: | ||
| baseline = json.load(f) | ||
| except FileNotFoundError: | ||
| print(f"No baseline found at {baseline_file}. Skipping comparison.") | ||
| return True | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| except Exception as e: | ||
| print(f"Error loading baseline performance results from {baseline_file}: {e}") | ||
| return False | ||
|
|
||
| regressions = [] | ||
|
|
||
| # Create map of baseline metrics | ||
| base_map = {b['name']: b.get('real_time') for b in baseline['benchmarks']} | ||
|
|
||
| print(f"{'Benchmark':<40} | {'Old (ns)':<12} | {'New (ns)':<12} | {'Change':<10}") | ||
| print("-" * 85) | ||
|
|
||
| for b in current['benchmarks']: | ||
| name = b['name'] | ||
| if name in base_map: | ||
| old_time = base_map[name] | ||
| new_time = b.get('real_time') | ||
|
|
||
| if old_time is None or new_time is None: | ||
| print(f"{name:<40} | {'N/A':<12} | {'N/A':<12} | {'N/A':>9}") | ||
| continue | ||
|
|
||
| # Guard against division by zero | ||
| if old_time <= 0: | ||
| print(f"{name:<40} | {old_time:<12.2f} | {new_time:<12.2f} | {'NEW/ZERO':>9}") | ||
| continue | ||
|
|
||
| # Increase in time means decrease in performance | ||
| change = (new_time - old_time) / old_time | ||
| print(f"{name:<40} | {old_time:<12.2f} | {new_time:<12.2f} | {change:>+9.1%}") | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if change > threshold: | ||
| regressions.append(f"{name} regressed by {change:.1%}") | ||
|
|
||
| if regressions: | ||
| print("\n!!! PERFORMANCE REGRESSION DETECTED !!!") | ||
| for r in regressions: | ||
| print(f" - {r}") | ||
| return False | ||
|
|
||
| print("\nPerformance is within acceptable limits.") | ||
| return True | ||
|
|
||
| if __name__ == "__main__": | ||
| if len(sys.argv) < 3: | ||
| print("Usage: check_perf_regression.py <current.json> <baseline.json> [threshold]") | ||
| sys.exit(1) | ||
|
|
||
| thresh = float(sys.argv[3]) if len(sys.argv) > 3 else 0.2 | ||
| if not check_regression(sys.argv[1], sys.argv[2], thresh): | ||
| sys.exit(1) | ||
This file contains hidden or 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 hidden or 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.
🧩 Analysis chain
🏁 Script executed:
Repository: poyrazK/cloudSQL
Length of output: 9868
Three uncompiled call sites still pass
std::unique_ptr<storage::HeapTable>to operators expectingstd::shared_ptr.The signature change to
SeqScanOperatorandIndexScanOperatorrequires all callers to passstd::make_shared<storage::HeapTable>instead ofstd::make_unique. Three locations insrc/executor/query_executor.cppstill need updating:Replace all three instances of
std::make_unique<storage::HeapTable>(...)withstd::make_shared<storage::HeapTable>(...)to resolve the compilation errors.🤖 Prompt for AI Agents