Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10917#discussion_r52095963
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Benchmark.scala ---
    @@ -124,7 +124,7 @@ private[spark] object Benchmark {
         }
         val best = runTimes.min
         val avg = runTimes.sum / iters
    -    Result(avg / 1000000, num / (best / 1000), best / 1000000)
    +    Result(avg / 1000000, num.toDouble / (best / 1000), best / 1000000)
    --- End diff --
    
    We need to keep the precision here.  The `bestMs/avgMs` can be well 
controlled in an appropriate number, but the `rate` can't. And we use `rate` as 
a divisor later, so if `rate` is small(assume we are benchmarking some slow 
operations), we will get large deviation. BTW, we use `%10.1f` to print `rate` 
but previously `rate` is always integral.
    
    cc @davies 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to