vsop-479 commented on issue #12788:
URL: https://github.com/apache/lucene/issues/12788#issuecomment-1809865124

   > To benchmark then use the benchmark-jmh Gradle module
   
   I measured max with scalar, unroll, vector  implementation by benchmark-jmh: 
     
   
       Benchmark                      (size)   Mode  Cnt   Score   Error   Units
       VectorUtilBenchmark.maxScalar     256  thrpt   15  51.056 ± 0.310  ops/us
       VectorUtilBenchmark.maxUnroll     256  thrpt   15  12.799 ± 0.036  ops/us
       VectorUtilBenchmark.maxVector     256  thrpt   15  53.381 ± 3.112  ops/us
   
   Assembly code indicates that: 
   Scalar get auto-vectorized, and auto-unrolled. @jpountz 
   Unroll doesn't get auto-vectorized.
   Vector get auto-unrolled.
   
   
   # Assembly code sample
   
   ````
   //  for scalar and vector.
   smax  v16.4s, v16.4s, v17.4s 
   add   w10, w2, #0x10  // 4 times smax, 1 add.
   
   // for unroll.
   cmp   w12, w11
   csel  w11, w12, w11, gt // cmp, csel. 
   ````


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