Skip to content

bugfix: modified table predicate filter #21362

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

Closed
wants to merge 2 commits into from

Conversation

daniel-brenot
Copy link

Replaces the string concatenation and index search with the .some check and a contains check. This should not be less efficient since the data is only getting checked once per row instead of twice, and the row will stop being looped over if a match is found earlier. Also removes unlikely edge case of a user inputing an obscure unicode character.

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 15, 2020
@daniel-brenot daniel-brenot changed the title chore: modified table predicate filter bugfix: modified table predicate filter Jan 5, 2021
Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

Performance-wise, I'm concerned that it's more expensive to call toLowerCase and includes for each column instead of once for each row after concatenating the values together. I'm sure the difference is small for most tables, but the solution may not scale to tables with many columns

@daniel-brenot
Copy link
Author

daniel-brenot commented Jan 9, 2021

I will run a performance benchmark in an online benchmark comparison and post a link

@daniel-brenot
Copy link
Author

daniel-brenot commented Jan 9, 2021

After testing using JSBench i have found the original algorithm to be 68% slower on average in the tests I made, on my machine. This is due to the overhead string concatenation as well as running toLowerCase and trim on a larger string being higher than the overhead of calling the function on each column(function call overhead in v8 is quite low when called in succession). You can confirm with the following jsbench snippet: https://jsbench.me/4bkjp85g44/1

@daniel-brenot
Copy link
Author

Bumping because of inactivity.

@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2021
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 29, 2021
@andrewseguin
Copy link
Contributor

@daniel-brenot Sorry for the inactivity - the change looks okay to me and we can run it by internal tests to confirm that it works well. Can you rebase?

@andrewseguin andrewseguin added the needs: clarification The issue does not contain enough information for the team to determine if it is a real bug label Mar 24, 2022
@daniel-brenot
Copy link
Author

I pulled the upstream into the the branch and it should be good now. Let me know if theres anything else i need to do.

@andrewseguin
Copy link
Contributor

I'm still seeing a note that "This branch cannot be rebased due to conflicts". You may want to perform a rebase with the original commit

@josephperrott josephperrott added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed needs rebase labels Nov 16, 2022
@andrewseguin
Copy link
Contributor

Will try to land this in #30172

@andrewseguin andrewseguin self-assigned this Dec 11, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews cla: yes PR author has agreed to Google's Contributor License Agreement needs: clarification The issue does not contain enough information for the team to determine if it is a real bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants