The word boundary extensions to &str/String behave in a very similar, but not identical manner to .graphemes(). For example, Mandarin to slow(ish) on .graphemes() but
fast(ish) on .word_boundaries() whereas languages with whitespace-delimited words tend to have the same performance characteristics with the latter methods.
As the library develops, it would be worthwhile to monitor the speed of the rest of the documented API.
Out of interest, here are the results of local benchmarking:
The word boundary extensions to &str/String behave in a very similar, but not identical manner to
.graphemes()
. For example, Mandarin to slow(ish) on.graphemes()
but fast(ish) on .word_boundaries() whereas languages with whitespace-delimited words tend to have the same performance characteristics with the latter methods.As the library develops, it would be worthwhile to monitor the speed of the rest of the documented API.
Out of interest, here are the results of local benchmarking: