-
Notifications
You must be signed in to change notification settings - Fork 321
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
Data analysts should be able to use Text.location_of
to find indexes within string using various matchers
#3324
Conversation
328e60f
to
1c3112d
Compare
Text.find
to find indexes within string using various matchersText.location_of
to find indexes within string using various matchers
1c3112d
to
963fe9a
Compare
LGTM - not sure whether we need the IntArrayBuilder over just using a Java List but no harm having it. |
Fair, but I wanted to avoid the cost of boxing which is incurred by the ArrayList. I did a very rudimentary benchmark (should use JMH to measure this properly, but just to get a general feeling) and over multiple runs the IntArrayBuilder seems to be more than twice as fast as the ArrayList (sometimes even ~30x faster). So I think it is worth it - while the cost of boxing is low, for such a low level operation it is still visible. Honestly I'm surprised that the standard library does not provide such a helper data structure - seems that such a structure is included in 'extensions' like Guava. |
Pull Request Description
Implements https://www.pivotaltracker.com/n/projects/2539304/stories/181266029
Important Notes
Checklist
Please include the following checklist in your PR:
./run dist
and./run watch
.