wanghan-sanechips commented on PR #3053:
URL: https://github.com/apache/kvrocks/pull/3053#issuecomment-3195782889

   > LGTM. One last question. As I observed the difference of test executing 
time (unit test and golang test) between native (x86) and qemu (x86-riscv) is 
quite small (less than 2x time). Previously I think that the speed can be more 
than 2x slower because of the riscv -> x86 transpilation. Is it expected?
   > 
   > I checked some benchmark (e.g. rv8 vs qemu: 
https://michaeljclark.github.io/bench.html) and it seems the performance of 
qemu is not so good. But maybe kvrocks is more IO-bound (network and file IO) 
so that the emulation performance (user-mode emulation?) is not critical.
   
   Thanks for raising this question! I've run more detailed benchmarks using 
these test cases:
   ```
   func cpuBound() { /* factorial calculation */ }      // BigInt math
   func ioBound() { /* 100x 1MB file writes */ }       // Disk I/O
   func hashTest() { /* 10M SHA-256 operations */ }    // Crypto hashing
   ```
   Results (x86 native vs QEMU RISC-V):
   | Test Type       | Native x86 | QEMU RISC-V | Slowdown |
   |-----------------|------------|-------------|----------|
   | CPU-bound (BigInt) | 297ms     | 953ms       | 3.2x     |
   | SHA-256 Hash      | 1.14s      | 24.7s       | 21.7x    |
   | Disk I/O         | 384ms      | 470ms       | 1.2x     |
   
   These results confirm your suspicion:
   1. Pure computation shows significant slowdown (3-20x) under QEMU emulation
   2. But I/O operations remain close to native speed (just 1.2x slower)
   
   This explains the performance gap.


-- 
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]

Reply via email to