Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Avoid unnecessary stores in readVarint on AArch64#677

Open
zongyao8752593 wants to merge 1 commit intofacebook:main from
zongyao8752593:varint
Open

Avoid unnecessary stores in readVarint on AArch64 #677
zongyao8752593 wants to merge 1 commit intofacebook:main from
zongyao8752593:varint

Conversation

@zongyao8752593
Copy link

@zongyao8752593 zongyao8752593 commented Oct 22, 2025

Instead of storing result to memory at each byte iteration, we can keep temp result in a register and only write to memory once at the end. This reduces unnecessary memory stores and improves performance.

Benchmark result without this patch:

[...]hrift/lib/cpp2/test/ProtocolBench.cpp relative time/iter iters/s

CompactProtocol_read_BigListBigInt 34.46us 29.02K

Benchmark result with this patch:

[...]hrift/lib/cpp2/test/ProtocolBench.cpp relative time/iter iters/s

CompactProtocol_read_BigListBigInt 30.21us 33.10K

Performance is uplifted by 14%.

Instead of storing result to memory at each byte iteration, we can keep
temp result in a register and only write to memory once at the end.
This reduces unnecessary memory stores and improves performance.
Benchmark result without this patch:
============================================================================
[...]hrift/lib/cpp2/test/ProtocolBench.cpp relative time/iter iters/s
============================================================================
CompactProtocol_read_BigListBigInt 34.46us 29.02K
Benchmark result with this patch:
============================================================================
[...]hrift/lib/cpp2/test/ProtocolBench.cpp relative time/iter iters/s
============================================================================
CompactProtocol_read_BigListBigInt 30.21us 33.10K
Performance is uplifted by 14%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

Comments

AltStyle によって変換されたページ (->オリジナル) /