Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19582#discussion_r148713957
  
    --- Diff: 
core/src/main/scala/org/apache/spark/status/AppStatusListener.scala ---
    @@ -528,4 +544,21 @@ private class AppStatusListener(kvstore: KVStore) 
extends SparkListener with Log
         entity.write(kvstore)
       }
     
    +  /** Update a live entity only if it hasn't been updated in the last 
configured period. */
    +  private def maybeUpdate(entity: LiveEntity): Unit = {
    +    if (liveUpdatePeriodNs >= 0) {
    +      val now = System.nanoTime()
    --- End diff --
    
    `System.nanoTime()` can be somewhat expensive, right?  there are a few 
places you are calling this repeatedly, might as well call `nanoTime()` once 
outside of this method and pass it in.


---

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

Reply via email to