components icon indicating copy to clipboard operation
components copied to clipboard

bugfix: modified table predicate filter

Open daniel-brenot opened this issue 5 years ago • 6 comments

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.

daniel-brenot avatar Dec 15 '20 21:12 daniel-brenot

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

daniel-brenot avatar Jan 09 '21 04:01 daniel-brenot

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 avatar Jan 09 '21 04:01 daniel-brenot

Bumping because of inactivity.

daniel-brenot avatar Jan 26 '21 20:01 daniel-brenot

@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 avatar Mar 24 '22 19:03 andrewseguin

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.

daniel-brenot avatar Mar 25 '22 03:03 daniel-brenot

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

andrewseguin avatar Apr 21 '22 19:04 andrewseguin