Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve .chars().count() #37888
Use a simpler loop to count the
benchmark descriptions and results for two configurations:
I briefly explored a more involved blocked algorithm (looking at 8 or more bytes at a time),
added a commit
this pull request
Nov 20, 2016
Nov 21, 2016
Go ahead and experiment. My comment was
I'm leaving the door open to such improvements, but I suggest looking out for the small-input case as well.
Oh by the way @llogiq did you see this comment? I wanted to tell you, due to possible appication in bytecount, that it can be beneficial (it was to me) to use this kind of raw pointer solution instead of computing separate slice parts up front. (Edit: Oh I now see why you couldn't possibly see that comment).