You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/07/09 13:45:22 UTC

[GitHub] [orc] belugabehr commented on pull request #743: ORC-834: Do Not Convert to String in DecimalFromTimestampTreeReader

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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org