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

os/bluestore: optimized (encode|decode)_escaped #15759

Merged
merged 1 commit into from Jun 27, 2017

Conversation

Projects
None yet
4 participants
@branch-predictor
Member

branch-predictor commented Jun 19, 2017

New versions don't append each char separately and don't call sprintf/sscanf for each encodable byte, giving at least 3x speedup for very short (< 4 bytes) keys and over 10x for keys > 50 bytes.

Signed-off-by: Piotr Dałek piotr.dalek@corp.ovh.com

@ifed01

ifed01 approved these changes Jun 19, 2017

Super!

bluestore: optimized (encode|decode)_escaped
New versions don't append each char separately and don't call sprintf/
sscanf for each encodable byte, giving at least 3x speedup for very
short (< 4 bytes) keys and over 10x for keys > 50 bytes over old
versions.

Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
snprintf(hexbyte, sizeof(hexbyte), "#%02x", (uint8_t)*i);
out->append(hexbyte);
*ptr++ = '#';
*ptr++ = "0123456789abcdef"[(*i >> 4) & 0x0f];

This comment has been minimized.

@tchaikov

tchaikov Jun 19, 2017

Contributor

how about ritoa<> defined in strtol.h?

@tchaikov

tchaikov Jun 19, 2017

Contributor

how about ritoa<> defined in strtol.h?

This comment has been minimized.

@branch-predictor

branch-predictor Jun 19, 2017

Member

It's slightly slower that way (ritoa<> puts chars in reverse).

@branch-predictor

branch-predictor Jun 19, 2017

Member

It's slightly slower that way (ritoa<> puts chars in reverse).

@liewegas liewegas changed the title from bluestore: optimized (encode|decode)_escaped to os/bluestore: optimized (encode|decode)_escaped Jun 20, 2017

@liewegas liewegas merged commit 94f0cd4 into ceph:master Jun 27, 2017

3 of 4 checks passed

arm64 make check arm64 make check failed
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details

@branch-predictor branch-predictor deleted the ovh:bp-optimized-bs-key-escape branch Jan 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment