3 ms·
Is the unsafe version doing bounds-checking? I imagine de-serializing is much faster without branching, although probably not a great idea. Hadoop's IPC protoc
by throwaway54-762 14y ago
Is the unsafe version doing bounds-checking? I imagine de-serializing is much faster without branching, although probably not a great idea.
Hadoop's IPC protocol does something similar to what this article describes. They roll their own serialization format[0] and write to a wrapped ByteArrayOutputStream[1].
[0]: Example of a serialized object: https://github.com/apache/hadoop-common/blob/fdf697eebc95cbb903a288c087d68f69553ee493/src/hdfs/org/apache/hadoop/hdfs/protocol/LocatedBlock.java https://github.com/apache/hadoop-common/blob/fdf697eebc95cbb...
[1]: https://github.com/apache/hadoop-common/blob/fdf697eebc95cbb903a288c087d68f69553ee493/src/core/org/apache/hadoop/io/DataOutputBuffer.java https://github.com/apache/hadoop-common/blob/fdf697eebc95cbb...
- pron 14y agoNo. No bounds checking.