Felix-Gong commented on PR #3375:
URL: https://github.com/apache/brpc/pull/3375#issuecomment-4910275273

   ## Benchmark Results — SG2044 (rv64gcv, VLEN=128, Clang 17, -O2 
-march=rv64gcv)
   
   Measured on SOPHGO SG2044 RISC-V 64-bit hardware with PR #3375 changes 
compiled using Clang 17 + glibc 2.38. Each data point is the median of 5 runs 
with 64-byte aligned buffers.
   
   | Size | memcpy (glibc) | cp_rvv (RVV e8m8) | Speedup |
   |---|---|---|---|
   | 64 B | 2.92 GB/s | 19.06 GB/s | **6.5x** |
   | 128 B | 5.13 GB/s | 21.08 GB/s | **4.1x** |
   | 256 B | 7.90 GB/s | 18.60 GB/s | **2.4x** |
   | 512 B | 4.62 GB/s | 15.79 GB/s | **3.4x** |
   | 1024 B | 8.75 GB/s | 10.83 GB/s | 1.2x |
   | 4 KB | 5.49 GB/s | 5.92 GB/s | 1.1x |
   | 16 KB | 4.01 GB/s | 4.01 GB/s | 1.0x |
   | 64 KB+ | ~2.7-3.2 GB/s | ~2.7-3.2 GB/s | ~1.0x |
   
   ### Analysis
   
   - **Small buffers (64-1024 B, L1/L2 cache resident)**: RVV achieves 
**1.2x–6.5x speedup** by issuing 128-bit vector load/store operations (LMUL=8 
processes 128 bytes per iteration on VLEN=128 hardware). This is the sweet spot 
for IOBuf operations — typical append/cut/push_back involve small block copies.
   - **Medium buffers (4-64 KB, L3 cache)**: Both implementations converge to 
L3 bandwidth limits.
   - **Large buffers (>64 KB, DRAM)**: Both are memory-bandwidth bound; no 
regression.
   
   ### Compiler Compatibility
   
   The implementation uses `__has_include(<riscv_vector.h>)` to gracefully fall 
back to memcpy when the RVV intrinsic header is unavailable (e.g., GCC \<= 13 
without bundled riscv_vector.h). Clang 17+ ships riscv_vector.h by default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to