ax1nch commented on PR #1628:
URL: https://github.com/apache/commons-lang/pull/1628#issuecomment-4322089299

   Hi Gary
   
   Sorry, missed including that last time. So below is that benchmark code I 
had run between the Default check and the new short-circuit check:
   ```
   import org.openjdk.jmh.infra.Blackhole;
   import org.openjdk.jmh.annotations.*;
   import java.util.concurrent.TimeUnit;
   import java.math.BigDecimal;
   
   @BenchmarkMode(Mode.AverageTime)
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   @State(Scope.Thread)
   @Fork(3)
   @Warmup(iterations = 3)
   @Measurement(iterations = 5)
   public class NumericCheck {
   
       private String input = "123.456789";
       //private String input = "1.1E20";
       Float f = Float.valueOf(input);
       Double d = Double.valueOf(input);
   
       @Benchmark
       public void testNumericPreCheck(Blackhole bh) {
           bh.consume((double) (float) d.doubleValue() == d.doubleValue());
       }
   
       @Benchmark
       public void testDefaultCheck(Blackhole bh) {
           bh.consume(f.toString().equals(d.toString()));
       }
   
   }
   ```
   Best, Anish


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