Github user kiszk commented on the issue:

    https://github.com/apache/spark/pull/19518
  
    I created and ran another synthetic benchmark program for comparing flat 
global variables, inner global variables, and array.  In summary, the 
followings are performance results (**small number is better**).
    - 0.65: flat global variables
    - 0.91: inner global variables
    - 1: array
    
    WDYT? Any comments are very appreciated.
    
    Here are 
[Test.java](https://gist.github.com/kiszk/63c2829488cb777d7ca78d45d20c021f) and 
[myInsntance.py](https://gist.github.com/kiszk/049a62f5d1259481c400a86299bd0228)
 that I used.
    
    ```
    $ cat /proc/cpuinfo | grep "model name" | uniq
    model name  : Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz
    $ java -version
    openjdk version "1.8.0_131"
    OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
    OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
    $ python myInstance.py > MyInstance.java && javac Test.java && java Test
    
    Result(us): Array
       0: 462848.969
       1: 461978.693
       2: 463174.459
       3: 461422.763
       4: 460563.915
       5: 460112.262
       6: 460059.957
       7: 460376.230
       8: 460245.445
       9: 460308.775
      10: 460154.955
      11: 460005.629
      12: 460330.584
      13: 460277.612
      14: 460181.360
      15: 460168.843
      16: 459790.137
      17: 460248.481
      18: 460344.471
      19: 460084.529
      20: 459987.263
      21: 459961.639
      22: 459952.447
      23: 460128.518
      24: 460025.783
      25: 459874.303
      26: 459932.685
      27: 460065.736
      28: 459954.526
      29: 459972.679
    BEST: 459790.137000, AVG: 460417.788
    
    Result(us): InnerVars
       0: 421013.480
       1: 420279.235
       2: 419366.157
       3: 421015.934
       4: 419540.049
       5: 420316.650
       6: 419816.612
       7: 420211.140
       8: 420215.864
       9: 421104.657
      10: 421836.430
      11: 420866.894
      12: 421457.850
      13: 421734.506
      14: 420796.010
      15: 419832.910
      16: 420012.167
      17: 420821.800
      18: 420962.178
      19: 421981.676
      20: 421721.257
      21: 419996.594
      22: 419742.884
      23: 420158.066
      24: 420156.773
      25: 420325.231
      26: 420966.914
      27: 420787.147
      28: 420296.789
      29: 420520.843
    BEST: 419366.157, AVG: 420595.157
    
    Result(us): Vars
       0: 343490.797
       1: 342849.079
       2: 341990.967
       3: 342844.044
       4: 343484.681
       5: 342586.419
       6: 342468.883
       7: 343113.300
       8: 343516.875
       9: 343002.395
      10: 341499.538
      11: 342192.102
      12: 341847.383
      13: 342533.215
      14: 341376.556
      15: 342018.111
      16: 341316.445
      17: 342043.378
      18: 341969.932
      19: 343415.854
      20: 343103.133
      21: 342084.686
      22: 341555.293
      23: 342984.355
      24: 342302.336
      25: 341994.372
      26: 342475.639
      27: 342281.214
      28: 342205.175
      29: 342462.032
    BEST: 341316.445, AVG: 342433.606
    ```



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to