spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject spark git commit: [SPARK-13113] [CORE] Remove unnecessary bit operation when decoding page number
Date Thu, 04 Feb 2016 07:17:55 GMT
Repository: spark
Updated Branches:
  refs/heads/master c2c956bcd -> d39087147


[SPARK-13113] [CORE] Remove unnecessary bit operation when decoding page number

JIRA: https://issues.apache.org/jira/browse/SPARK-13113

As we shift bits right, looks like the bitwise AND operation is unnecessary.

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #11002 from viirya/improve-decodepagenumber.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d3908714
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d3908714
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d3908714

Branch: refs/heads/master
Commit: d39087147ff1052b623cdba69ffbde28b266745f
Parents: c2c956b
Author: Liang-Chi Hsieh <viirya@gmail.com>
Authored: Wed Feb 3 23:17:51 2016 -0800
Committer: Davies Liu <davies.liu@gmail.com>
Committed: Wed Feb 3 23:17:51 2016 -0800

----------------------------------------------------------------------
 core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d3908714/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java b/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
index d31eb44..d2a8886 100644
--- a/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
+++ b/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
@@ -312,7 +312,7 @@ public class TaskMemoryManager {
 
   @VisibleForTesting
   public static int decodePageNumber(long pagePlusOffsetAddress) {
-    return (int) ((pagePlusOffsetAddress & MASK_LONG_UPPER_13_BITS) >>> OFFSET_BITS);
+    return (int) (pagePlusOffsetAddress >>> OFFSET_BITS);
   }
 
   private static long decodeOffset(long pagePlusOffsetAddress) {


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


Mime
View raw message