-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: invalid benchmark scripts #622
Conversation
WalkthroughThe pull request involves modifications to multiple performance test script files, specifically Changes
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
test/performance/scripts/any_unbounded_to_any.js (1)
2-22
: LGTM! Consider extracting UUID prefix stringsThe script correctly handles dynamic source and destination accounts with proper variable declarations. However, the "src:" and "dst:" prefixes could be extracted as constants for better maintainability.
Consider this improvement:
+const SRC_PREFIX = "src:"; +const DST_PREFIX = "dst:"; + function next() { return [{ action: 'CREATE_TRANSACTION', data: { script: { plain: `vars { account $source account $destination } send [USD/2 100] ( source = $source allowing unbounded overdraft destination = $destination )`, vars: { - destination: "dst:" + uuid(), - source: "src:" + uuid() + destination: DST_PREFIX + uuid(), + source: SRC_PREFIX + uuid() } } } }] }test/performance/scripts/any_bounded_to_any.js (1)
16-17
: Consider more descriptive variable names for test accounts.The current
src:
anddst:
prefixes could be more descriptive for benchmark clarity.- destination: "dst:" + uuid(), - source: "src:" + uuid() + destination: "test_destination:" + uuid(), + source: "test_source:" + uuid()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
test/performance/scripts/any_bounded_to_any.js
(1 hunks)test/performance/scripts/any_unbounded_to_any.js
(1 hunks)test/performance/scripts/world_to_any.js
(1 hunks)test/performance/scripts/world_to_bank.js
(1 hunks)
🔇 Additional comments (3)
test/performance/scripts/world_to_bank.js (1)
2-15
: LGTM! Verify benchmark runner compatibility
The changes look correct and maintain consistent structure with other benchmark scripts.
Let's verify the benchmark runner expects this new array return type:
test/performance/scripts/world_to_any.js (1)
2-20
: LGTM! Structure and variable usage are correct
The script properly declares and uses the dynamic destination variable, maintaining consistency with the new array return type.
test/performance/scripts/any_bounded_to_any.js (1)
2-22
: LGTM! Verify consistency across benchmark scripts.
The restructuring to return an array and nest script-related properties under a script
object improves organization. This aligns with the PR objective of fixing invalid benchmark scripts.
Let's verify the consistency of this pattern across other benchmark scripts:
✅ Verification successful
Consistent structure verified across all benchmark scripts
The verification shows that all benchmark scripts in the test/performance/scripts/
directory follow the same pattern:
- Return an array containing a single transaction object
- Use consistent structure with
action
and nestedscript
object underdata
- Follow similar variable declaration patterns
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if all benchmark scripts follow the same pattern
# Expected: All scripts should return arrays and use the script object structure
# Search for next() function implementations in benchmark scripts
ast-grep --pattern 'function next() {
return $$$
}'
# Verify the script object structure is consistent
rg -g 'test/performance/scripts/*.js' -A 5 'script: {'
Length of output: 6371
No description provided.