Github user kiszk commented on the issue:

    https://github.com/apache/spark/pull/19518
  
    @cloud-fan you are right, I am updating benchmark program and results.
    I realized that one issue of the array approach: **limitation of constant 
pool entries due to array access index**
    
    When we use an array approach, a global variable will be accessed by 
`this.globalVar[12345]`. Here is a bytecode sequence. Each access to an array 
element (index is greater than 5 since iconst_0 ... iconst_5 do not use 
constant pool entry) requires one constant pool entry.  
    While we reduce one constant pool entry for global variable, we require one 
constant pool entry.
    @bdrillard did your implementation (probably around 
[here](https://github.com/apache/spark/pull/19518/files#diff-8bcc5aea39c73d4bf38aef6f6951d42cR218))
 avoid this issue?
    
    WDYT? cc @viirya @maropu 
    
    ```
    aload 0  // load this
    getfield [constant pool index] // load this.globalVar
    ldc [constant pool index] // load 12345 from constant pool and push it
    iaload
    ```



---

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

Reply via email to