[
https://issues.apache.org/jira/browse/SPARK-53214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated SPARK-53214:
-----------------------------------
Labels: pull-request-available (was: )
> Use Java `HexFormat` instead of `Hex.encodeHexString`
> -----------------------------------------------------
>
> Key: SPARK-53214
> URL: https://issues.apache.org/jira/browse/SPARK-53214
> Project: Spark
> Issue Type: Sub-task
> Components: Kubernetes, Spark Core, SQL
> Affects Versions: 4.1.0
> Reporter: Dongjoon Hyun
> Priority: Major
> Labels: pull-request-available
>
> Java native method is roughly **2x** faster.
> {code}
> scala> val a = new Array[Byte](1_000_000_000)
> scala> spark.time(org.apache.commons.codec.binary.Hex.encodeHexString(a,
> false).length)
> Time taken: 1559 ms
> val res0: Int = 2000000000
> scala>
> spark.time(java.util.HexFormat.of().withUpperCase().formatHex(a).length)
> Time taken: 672 ms
> val res1: Int = 2000000000
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]