Demogorgon314 edited a comment on pull request #13246:
URL: https://github.com/apache/pulsar/pull/13246#issuecomment-991868100


   Here is a simple benchmark for arm64 instructions optimized and software 
implementation, the performance is improved by **6** times.
   ```cpp
   TEST(ClientTest, testSwHwArmChecksumBench) {
       std::string data = "This is a simple benchmark for CRC32C hardware and 
software implementation.";
       int times = 100000;
       clock_t startTime,endTime;
       uint32_t hwArmChecksum;
       startTime = clock();
       for(int i = 0; i < times; i++) {
           hwArmChecksum = crc32cHwArm(0, (char *)data.c_str(), data.length());
       }
       endTime = clock();
       LOG_INFO("Crc32cHwArm run time is: " << endTime - startTime << " ms");
       uint32_t swChecksum;
       startTime = clock();
       for(int i = 0; i < times; i++) {
           swChecksum = crc32cSw(0, (char *)data.c_str(), data.length());
       }
       endTime = clock();
       LOG_INFO("Crc32cSw run time is: " << endTime - startTime << " ms");
   }
   ```
   Result:
   ```text
   2021-12-12 17:58:36.299 INFO  [0x10594c580] ClientTest:104 | Crc32cHwArm run 
time is: 563 ms
   2021-12-12 17:58:36.303 INFO  [0x10594c580] ClientTest:111 | Crc32cSw run 
time is: 3840 ms
   ```


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