Skip to content
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

Improve performance of match any word #142

Open
daedalus28 opened this issue Aug 11, 2017 · 2 comments
Open

Improve performance of match any word #142

daedalus28 opened this issue Aug 11, 2017 · 2 comments
Assignees

Comments

@daedalus28
Copy link
Contributor

Similar to #138, if we instead construct 1 regex, it will be much faster. The match any case is easy - just join words with |.

@tvsudhir
Copy link

tvsudhir commented Aug 27, 2017

PR for this issue #150

daedalus28 added a commit that referenced this issue Aug 30, 2017
@leftfields
Copy link

leftfields commented Sep 12, 2017

@daedalus28 Have you considered just using string operators for this ie. str.indexOf, opposed to the regexp implementation you are using now? In many cases string operators can run faster and also with the str.indexOf approach you will no longer need to run the input through the 'words' fn to create an array which may be costly in terms of speed as well.

See: https://stackoverflow.com/questions/4757438/javascript-indexof-vs-match-when-searching-strings

leftfields pushed a commit to leftfields/futil-js that referenced this issue Sep 13, 2017
…se curried string operators. This seems to be faster and more relaible when working with large strings.
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

No branches or pull requests

4 participants