Skip to content

Closes #3579: Update str_locality_benchmark - #4712

Merged
ajpotts merged 1 commit into
Bears-R-Us:mainfrom
ajpotts:3579_Update_str_locality_benchmark
Aug 5, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:mainfrom
ajpotts:3579_Update_str_locality_benchmark

Conversation

@ajpotts

@ajpotts ajpotts commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

PR: Refactor str_locality_benchmark.py for Clarity and Consistency

This PR makes minor refinements to the str_locality_benchmark.py benchmark while maintaining its original functionality and performance focus.

✅ Changes Made

  • Seed Handling: Avoids mutating pytest.seed directly by incrementing a local copy when generating the second string component. This ensures reproducibility without side effects across tests.
  • Consistent Data Size Calculation: Uses data.nbytes consistently for transfer rate calculation.
  • Minor Code Cleanup: Simplified logic for generating sorted/unsorted string arrays for locality effects.

🔍 Behavior

  • No Correctness Mode: The benchmark remains performance-only, skipping when --correctness_only or --numpy is set.
  • Parameters: Benchmarks string locality effects (Good vs Poor) across four operations (Hashing, Regex_Search, Casting, Scalar_Compare).
  • Metadata: Still reports problem size, backend, and transfer rate.

This refactor improves maintainability and reproducibility while keeping results comparable with previous runs.

Closes #3579: Update str_locality_benchmark

@ajpotts
ajpotts marked this pull request as ready for review July 15, 2025 20:49
@ajpotts
ajpotts marked this pull request as draft July 15, 2025 21:16
@ajpotts
ajpotts marked this pull request as ready for review July 15, 2025 21:52
Comment thread benchmark_v2/str_locality_benchmark.py Resolved
@ajpotts
ajpotts force-pushed the 3579_Update_str_locality_benchmark branch from d63a7cc to f827f71 Compare July 24, 2025 14:44
@ajpotts
ajpotts force-pushed the 3579_Update_str_locality_benchmark branch from f827f71 to 8312b64 Compare July 24, 2025 19:38
@ajpotts
ajpotts changed the base branch from master to main July 25, 2025 14:09

@1RyanK 1RyanK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@jaketrookman jaketrookman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@ajpotts
ajpotts added this pull request to the merge queue Aug 4, 2025
Merged via the queue into Bears-R-Us:main with commit 9d51217 Aug 5, 2025
drculhane pushed a commit to drculhane/arkouda that referenced this pull request Aug 20, 2025
## PR: Refactor `str_locality_benchmark.py` for Clarity and Consistency

This PR makes minor refinements to the `str_locality_benchmark.py`
benchmark while maintaining its original functionality and performance
focus.

### ✅ Changes Made
- **Seed Handling**: Avoids mutating `pytest.seed` directly by
incrementing a local copy when generating the second string component.
This ensures reproducibility without side effects across tests.
- **Consistent Data Size Calculation**: Uses `data.nbytes` consistently
for transfer rate calculation.
- **Minor Code Cleanup**: Simplified logic for generating
sorted/unsorted string arrays for locality effects.

### 🔍 Behavior
- **No Correctness Mode**: The benchmark remains performance-only,
skipping when `--correctness_only` or `--numpy` is set.
- **Parameters**: Benchmarks string locality effects (`Good` vs `Poor`)
across four operations (`Hashing`, `Regex_Search`, `Casting`,
`Scalar_Compare`).
- **Metadata**: Still reports problem size, backend, and transfer rate.

This refactor improves maintainability and reproducibility while keeping
results comparable with previous runs.


Closes Bears-R-Us#3579:  Update str_locality_benchmark

Co-authored-by: ajpotts <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update str_locality_benchmark

4 participants