Closed Code-Hex closed 3 years ago
@rivo Review please~~~~ ππ π π π π π
Any news on this PR? It is a nice optimization.
Could be improved more: use local variables for slices and create the Grapheme
object only after the loop.
This performance optimization uses more memory. To allocate the right amount (loosing some speed), use utf8.RuneCountInString
instead of len
.
I merged #8 instead. Hope that's ok with you.
This PR will be improving performance when called
GraphemeClusterCount
function.benchmark code.
Result