belugabehr commented on pull request #743:
URL: https://github.com/apache/orc/pull/743#issuecomment-877200933


   A quick test (hardly definitive, but indicative) shows an order of magnitude 
performance improvement:
   
   ```java
       long t1 = System.nanoTime();
       long r = 0;
       for (long i = -100_000L; i < 100_000; i++) {
         BigDecimal secondsBd = new BigDecimal(i);
         BigDecimal nanosBd = new BigDecimal(i).movePointLeft(9);
         BigDecimal resultBd = (i >= 0L) ? secondsBd.add(nanosBd) : 
secondsBd.subtract(nanosBd);
         r += resultBd.longValue();
       }
       long t2 = System.nanoTime();
   
       System.out.println(r);
       System.out.println(t2 - t1);
   ```
   
   This can be done even faster by more fully utilizing the Hive 
BigDecimalWritable stuff, but this is a good start.


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