Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4783#discussion_r26208364
--- Diff: core/src/main/scala/org/apache/spark/util/SizeEstimator.scala ---
@@ -279,8 +315,8 @@ private[spark] object SizeEstimator extends Logging {
newInfo
}
- private def alignSize(size: Long): Long = {
- val rem = size % ALIGN_SIZE
- if (rem == 0) size else (size + ALIGN_SIZE - rem)
- }
+ private def alignSize(size: Long): Long = alignSizeUp(size, ALIGN_SIZE)
+
+ private def alignSizeUp(size: Long, alignSize: Int): Long =
+ (size + alignSize - 1) & ~(alignSize - 1)
--- End diff --
Can you perhaps explain this computation? I get what it does, but it's not
obvious.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]