]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common: optimize encode_utf8
authorYibo Cai <yibo.cai@arm.com>
Tue, 23 Apr 2019 05:22:31 +0000 (13:22 +0800)
committerYibo Cai <yibo.cai@arm.com>
Fri, 26 Apr 2019 07:22:36 +0000 (15:22 +0800)
commit78691d321d3ced54fc82de86060e5ab0a3944deb
treedeec05065b65d53a226dc60c6a2c95978024632d
parent8a4a6ab1962390a6e77c90d95c542c614759b699
common: optimize encode_utf8

Unroll loop manually to accelerate UTF-8 byte sequence encoding.
Achieves 30% to 50% performance gain on x86 and Arm servers.

NOTE: Per https://en.wikipedia.org/wiki/UTF-8#Invalid_code_points,
since RFC3629(November 2003), code points after U+10FFFF must be
treated as invalid UTF-8 byte sequence.
But to be compatible with curent code, this implementation still
accepts these illegal strings.

Signed-off-by: Yibo Cai <yibo.cai@arm.com>
src/common/utf8.c