You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2025/01/08 07:43:43 UTC

[PR] [SPARK-50685][PYTHON][FOLLOW-UP] Improve Py4J performance by leveraging getattr [spark]

HyukjinKwon opened a new pull request, #49412:
URL: https://github.com/apache/spark/pull/49412

   ### What changes were proposed in this pull request?
   
   This PR is. a followup of https://github.com/apache/spark/pull/49313 that fixes more places missed.
   
   This PR fixes Core, SQL, ML and Structured Streaming. Tests codes, MLLib and DStream are not affected.
   
   ### Why are the changes needed?
   
   To reduce the overhead of Py4J calls.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Manually tested as demonstrated in https://github.com/apache/spark/pull/49312
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-50685][PYTHON][FOLLOW-UP] Improve Py4J performance by leveraging getattr [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #49412:
URL: https://github.com/apache/spark/pull/49412#issuecomment-2577482923

   To optimize Py4J calls, does it make sense to further cache the result? e.g.
   
   ```
   @functools.lru_cache(maxsize=128)
   def get_jvm_attr(jvm: "JVMView", name: str) -> Any:
       return getattr(jvm, name)
   ```


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-50685][PYTHON][FOLLOW-UP] Improve Py4J performance by leveraging getattr [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #49412: [SPARK-50685][PYTHON][FOLLOW-UP] Improve Py4J performance by leveraging getattr
URL: https://github.com/apache/spark/pull/49412


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-50685][PYTHON][FOLLOW-UP] Improve Py4J performance by leveraging getattr [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #49412:
URL: https://github.com/apache/spark/pull/49412#issuecomment-2578932884

   Yeah but we should think about how it will affect GC in Python and JVM. 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-50685][PYTHON][FOLLOW-UP] Improve Py4J performance by leveraging getattr [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #49412:
URL: https://github.com/apache/spark/pull/49412#issuecomment-2579137745

   Merged to master.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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