Skip to content

LIKE tweaks for performance - #2716

Merged
joocer merged 4 commits into
mainfrom
microoptimizations/4
Aug 2, 2025
Merged

LIKE tweaks for performance#2716
joocer merged 4 commits into
mainfrom
microoptimizations/4

Conversation

@joocer

@joocer joocer commented Aug 2, 2025

Copy link
Copy Markdown
Member

Thank you for opening a Pull Request!

We appreciate your contribution to Opteryx. Your time and effort make a difference, and we鈥檙e excited to review your changes. To help ensure a smooth review process, please check the following:

Checklist for a Successful PR

  • Start the conversation: If you haven鈥檛 already, raise a bug/feature request or start a discussion. This ensures alignment on the change and approach.
  • Run the tests: Confirm that all tests pass without errors.
  • Maintain code coverage: If you鈥檝e added or modified source code ensure new tests are added to the test suite.
  • Update documentation and tests (if applicable): If your changes impact functionality, make sure the relevant docs and test cases are updated.

Fixes: #<issue_number_goes_here>

Please replace <issue_number_goes_here> with the corresponding issue number.


Thank you for contributing to Opteryx! 馃帀

@github-actions

github-actions Bot commented Aug 2, 2025

Copy link
Copy Markdown

馃摝 Opteryx build version: 0.25.0-beta.1414

@github-actions

github-actions Bot commented Aug 2, 2025

Copy link
Copy Markdown

馃摝 Opteryx build version: 0.25.0-beta.1415

@joocer
joocer requested a review from Copilot August 2, 2025 09:54

Copilot AI 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.

Pull Request Overview

This PR refactors string-related operations for performance improvements by renaming the list_substring module to list_in_string and optimizing various algorithms. The changes focus on improving LIKE operations and substring search functionality.

  • Renamed list_substring functions to list_in_string across multiple files
  • Optimized Boyer-Moore-Horspool algorithm with better variable handling and type improvements
  • Updated output handling to use native JSON serialization instead of orjson

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
opteryx/managers/expression/ops.py Updated function calls from list_substring to list_in_string
opteryx/functions/other_functions.py Updated function calls from list_substring to list_in_string
opteryx/compiled/table_ops/hash_ops.pyx Cleaned up comments and formatting
opteryx/compiled/list_ops/list_in_string.pyx Renamed functions, optimized Boyer-Moore algorithm, improved type safety
opteryx/version.py Updated build number
opteryx/main.py Added redundant print statements and switched to native JSON

Comment thread opteryx/compiled/list_ops/list_in_string.pyx Outdated

if needlelen == 0:
return -1 # No valid search possible
return 0 # No valid search possible

Copilot AI Aug 2, 2025

Copy link

Choose a reason for hiding this comment

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

Changed return value from -1 to 0 for empty needle case. This changes the function's behavior - returning 0 means 'no match found' while the original -1 likely indicated an error condition. This could break calling code that expects -1 for invalid inputs.

Suggested change
return 0 # No valid search possible
return -1 # No valid search possible (invalid input)

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 2, 2025

Copy link
Copy Markdown

馃摝 Opteryx build version: 0.25.0-beta.1415

@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2025

Copy link
Copy Markdown

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@joocer
joocer merged commit eebcd8a into main Aug 2, 2025
21 of 22 checks passed
@joocer
joocer deleted the microoptimizations/4 branch August 2, 2025 10:11
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.

2 participants