apache/brpc/f16ab1c581746919fb394c3cfd3735ed83a4e3bc snappy: optimize UnalignedCopy64 and IncrementalCopy for RISC-V (#3360)
* snappy: optimize UnalignedCopy64 and IncrementalCopy for RISC-V
Use RISC-V inline assembly (ld/sd) for 8-byte copy operations instead
of generic macro-based implementation.
Changes:
- UnalignedCopy64: direct ld/sd pair for 8-byte copy
- IncrementalCopy: 8-byte bulk copies when source/dest don't overlap
Performance improvement (direct function benchmark):
- Decompress compressible-256K: 728 MB/s -> 2205 MB/s (+203%)
- Decompress zeros-256K: 543 MB/s -> 1462 MB/s (+169%)
Tests: brpc_snappy_compress_unittest passed (7/7)
Signed-off-by: Xiaofei Gong <gongxiaofei24@iscas.ac.cn>
Signed-off-by: YuanSheng <yuansheng@isrc.iscas.ac.cn>
* snappy: add alignment check for RISC-V ld/sd optimization
Address Copilot review: ld/sd require 8-byte alignment. Add runtime
alignment check and fall back to memcpy/byte-copy for unaligned
addresses to avoid traps on implementations that don't support
misaligned access.
Signed-off-by: Xiaofei Gong <gongxiaofei24@iscas.ac.cn>
Signed-off-by: YuanSheng <yuansheng@isrc.iscas.ac.cn>
---------
Signed-off-by: Xiaofei Gong <gongxiaofei24@iscas.ac.cn>
Signed-off-by: YuanSheng <yuansheng@isrc.iscas.ac.cn>
2 files changed
tree: ac437babbdea7ed48dc54afc2fed9ca70b6d02e7
- .github/
- bazel/
- cmake/
- community/
- docs/
- example/
- homebrew-formula/
- java/
- package/
- python/
- registry/
- src/
- test/
- tools/
- .asf.yaml
- .bazelignore
- .bazelrc
- .bazelversion
- .gitignore
- .licenserc.yaml
- AGENTS.md
- BUILD.bazel
- CHANGES.md
- CLAUDE.md
- CMakeLists.txt
- CODE_OF_CONDUCT.md
- config.h.in
- config_brpc.sh
- CONTRIBUTING.md
- Dockerfile
- LICENSE
- Makefile
- MODULE.bazel
- NOTICE
- README.md
- README_cn.md
- RELEASE_VERSION
- SECURITY.md
- THREAT_MODEL.md
- WORKSPACE
- WORKSPACE.bzlmod
README.md
中文版


bRPC is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc.
“bRPC” means “better RPC”.
You can use it to:
- Build a server that can talk in multiple protocols (on same port), or access all sorts of services
- restful http/https, h2/gRPC. using http/h2 in bRPC is much more friendly than libcurl. Access protobuf-based protocols with HTTP/h2+json, probably from another language.
- redis and memcached, thread-safe, more friendly and performant than the official clients.
- rtmp/flv/hls, for building streaming services.
- hadoop_rpc (may be opensourced)
- rdma support
- thrift support, thread-safe, more friendly and performant than the official clients.
- all sorts of protocols used in Baidu: baidu_std, streaming_rpc, hulu_pbrpc, sofa_pbrpc, nova_pbrpc, public_pbrpc, ubrpc and nshead-based ones.
- Build HA distributed services using an industrial-grade implementation of RAFT consensus algorithm which is opensourced at braft
- Servers can handle requests synchronously or asynchronously.
- Clients can access servers synchronously, asynchronously, semi-synchronously, or use combo channels to simplify sharded or parallel accesses declaratively.
- Debug services via http, and run cpu, heap and contention profilers.
- Get better latency and throughput.
- Extend bRPC with the protocols used in your organization quickly, or customize components, including naming services (dns, zk, etcd), load balancers (rr, random, consistent hashing)
Try it!
Contribute code
Please refer to here.
Feedback and Getting involved
Code of Conduct
We follow the code of conduct from Apache Software Foundation, please refer it here Link