You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2017/10/08 12:01:05 UTC

[jira] [Assigned] (SPARK-22147) BlockId.hashCode allocates a StringBuilder/String on each call

     [ https://issues.apache.org/jira/browse/SPARK-22147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen reassigned SPARK-22147:
---------------------------------

      Assignee: Sergei Lebedev
    Issue Type: Improvement  (was: Bug)

> BlockId.hashCode allocates a StringBuilder/String on each call
> --------------------------------------------------------------
>
>                 Key: SPARK-22147
>                 URL: https://issues.apache.org/jira/browse/SPARK-22147
>             Project: Spark
>          Issue Type: Improvement
>          Components: Block Manager
>    Affects Versions: 2.2.0
>            Reporter: Sergei Lebedev
>            Assignee: Sergei Lebedev
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> The base class {{BlockId}} [defines|https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/storage/BlockId.scala#L44] {{hashCode}} and {{equals}} for all its subclasses in terms of {{name}}. This makes the definitions of different ID types [very concise|https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/storage/BlockId.scala#L52]. The downside, however, is redundant allocations. While I don't think this could be the major issue, it is still a bit disappointing to increase GC pressure on the driver for nothing. For our machine learning workloads, we've seen as much as 10% of all allocations on the driver coming from {{BlockId.hashCode}} calls done for [BlockManagerMasterEndpoint.blockLocations|https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala#L54].



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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