diff options
author | Shixiong Zhu <shixiong@databricks.com> | 2015-12-01 09:45:55 -0800 |
---|---|---|
committer | Shixiong Zhu <shixiong@databricks.com> | 2015-12-01 09:45:55 -0800 |
commit | 1401166576c7018c5f9c31e0a6703d5fb16ea339 (patch) | |
tree | 3cdfa3ce9c6cd6eefe56ea1a5491b45f4392556f /tools | |
parent | c87531b765f8934a9a6c0f673617e0abfa5e5f0e (diff) | |
download | spark-1401166576c7018c5f9c31e0a6703d5fb16ea339.tar.gz spark-1401166576c7018c5f9c31e0a6703d5fb16ea339.tar.bz2 spark-1401166576c7018c5f9c31e0a6703d5fb16ea339.zip |
[SPARK-12060][CORE] Avoid memory copy in JavaSerializerInstance.serialize
`JavaSerializerInstance.serialize` uses `ByteArrayOutputStream.toByteArray` to get the serialized data. `ByteArrayOutputStream.toByteArray` needs to copy the content in the internal array to a new array. However, since the array will be converted to `ByteBuffer` at once, we can avoid the memory copy.
This PR added `ByteBufferOutputStream` to access the protected `buf` and convert it to a `ByteBuffer` directly.
Author: Shixiong Zhu <shixiong@databricks.com>
Closes #10051 from zsxwing/SPARK-12060.
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions